Running Zend Core with Apache
I just had to go through a rather painful exercise of configuring Zend Core to run with Apache. The initial experience was promising as the installer asked a bunch of questions, but then just hung in the taskbar without a window. The installer has gone far enough to actually download and install the Apache server on my system. However, it didn't get to the point to configure the Apache web server to handle the execution of the PHP scripts. I went through the pain of figuring it out, so if you're in the similar situation, read on as the resources on the web are very scarce and Zend does not publish any clear instructions on how to configure their product to run under Apache. The instructions assume that you accepted all the default values during the installation (specifically the installation path - C:\Program Files\Zend)
- The Apache web server uses httpd.conf configuration file. The file is located in C:\Program Files\Zend\Apache2\conf. Open the file and add the following configuration (does not matter where, I added at the bottom):
LoadModule zend_enabler_module "C:/Program Files/Zend/Core/modules/apache2.2/zend_fcgi.dll"
FastCgiConfig "C:/Program Files/Zend/Core/etc/fastcgi.conf"
AddHandler fastcgi-script .php .php3 .phtml .inc
AddType application/x-httpd-php .php .php3 .phtml .inc
<Location>
Order deny,allow
Allow from all
</Location>
Alias /ZendCore "C:/Program Files/Zend/Core/GUI" - The configuration above references application/x-httpd-php mime type, which should be registered in mime.conf located in the same directory as httpd.conf (C:\Program Files\Zend\Apache2\conf). Add the following line in mime.conf:
application/x-httpd-php php php3 phtml inc - There is a reference to fastcgi.conf in the configuration added in step 1. I am not familiar with FastCGI, so it was the biggest pain to find a sample for that file as Zend does not provide one. Create a text file with the name fastcgi.conf in the following directory C:\Program Files\Zend\Core\etc. The file must have the following content:
Server type="application/x-httpd-php" CommandLine="C:\Program Files\Zend\Core\bin\php-cgi.exe" ConnectionTimeout="240" RequestTimeout="360" StartProcesses="16" Impersonate="1" SetEnv="PHP_FCGI_MAX_REQUESTS=10000" SetEnv="PHP_FCGI_CHILDREN=1" SetEnv="PATH=?" SetEnv="TEMP=C:\Program Files\Zend\Core\temp" SetEnv="OS=?" SetEnv="SystemRoot=?" SetEnv="ComSpec=?" SetEnv="DB2INSTANCE=?"
MinDynamicServers 8
MaxDynamicServers 32
IpcDir "C:\Program Files\Zend\Core\temp"
IMPORTANT: For the configuration shown above, make sure the file has only FOUR lines: one that starts with "Server", followed by "MinDynamicServers", "MaxDynamicServers" and "IpcDir". So all the line breaks in the "Server" line must be removed, otherwise configuration processing will fail. - The document root for your PHP code is C:\Program Files\Zend\Apache2\htdocs. If you are deploying WebORB, this is where the zip file must be extracted to. To test if PHP is working, place a test script (call it test.php) with phpinfo() into htdocs. Start (or restart) the Apache server and load it from http://localhost/test.php
Here's a sample of test.php:
<?php
phpinfo();
?> - Finally configuring php.ini requires a few extra steps. It is still a mystery for me what algorithm PHP/Zend uses to locate php.ini, but generally speaking copying it to your /Windows directory works. Notice that php.ini that comes with Zend does not enable any extensions, so you'd have to do it by yourself.
The really cool news though is that WebORB runs absolutely flawlessly under Zend Framework, including service browser, test drive and our brand new data management implementation.








2 Comments:
Hi,
I'm a product manager at Zend, and this kind of feedback is very valuable for us, as we are now in the process of evaluating the technology for the next generation of Zend Core.
I'd be happy if you can contact me personally at shahar dot e at zend dot com so we could see if we can solve these issues in the future.
Best regards,
Shahar Evron.
9:37 AM
even without Zend, PHP is difficult to configure - especially extensions. For a while, I have used a pre-configured php.ini file and browscap.ini file to quickly set up a WAMP/WIMP stack. Most of my pain extended from not having enough information in the error logs to troubleshoot it easily. Setting up Weborb, however is VERY easy and intuitive - documentation is great too!
12:50 PM
Post a Comment
<< Home