Niall Mullen's Weblog

Niall Mullen's Weblog
Friday Feb 03, 2006

specweb 2005 configuration : PHP

This blog entry forms one part of a larger guide to specweb2005 which
is indexed here.

PHP Compilation

Specbweb2005 provides two different options for the server side script implementation,
PHP or Jsp. For php to be used the php distribution must be compiled such that the
libphp is correct for your webserver, i.e. nsapi for Sun Java Webserver, isapi for Zeus
or Windows, or fastcgi for apache.

Secondly the compiled PHP module must be installed on the webserver.
First setp is to grab a copy of the php source here.

php.net contains a perfectly good guide on howto build php , the only thing which I feel needs to be added here is specifically what arguments need to be
passed to the compile to build the different module types listed above.

The php compile will require your webserver of choice to be installed already so that it can
source header files from the webserver to correctly build the libphp module, so I'll assume the
following locations:

Sun Java Webserver - /opt/SUNWwbsvr
apache2 - /usr/apache2 ( there by default with solaris10 )
Zeus /opt/zeus

Of course your only going to need one of these, which ever you prefer.

To build the nsapi module use the following command:

./configure --with-nsapi=/opt/SUNWwbsvr --enable-libgcc --enable-libxml

For isapi:

./configure --with-isapi=/opt/zeus --enable-libgcc --enable-libxml

And for fastgi / apache2

./configure --enable-libgcc --enable-libxml --enable-fastcgi --with-apxs2filter=/usr/apache2/bin/apxs

The follow this with:

make
make install

This will build your php distribution. The module you need to deploy in your webserver
can be found in the libs directoy and is called ( at the time of writing ) libphp5.so.

-rwxr-xr-x 1 root root 6249892 Jan 13 15:03 libphp5.so

Deployment in Webserver

This is already covered in as much detail as I could on php.net
The only thing to be aware of is that the documents are for php4, so
if your using php5 ( or 6 or 7 someday ... ) all instances of "php4"
in the config files should be changed to php5.

For Sun Java Webserver the guide is here.
For apache2.0 the guide is here.
For zeus instructions can be found on the zeus website here.

Adding the specweb dynamic php scripts

Once php is up and running a final simple step that must be taken,
is to add the spec supplied php scripts to the fileset,
which is simply a case of dumping the files across,
and of course making sure that your webserver user has permissions to access them !

chown -R nobody:nobody /export/bench/specweb2005-102/scripts/php
cd /export/bench/specweb2005-102/scripts/php
find . |cpio -pdumv /export/fileset

The final thing to do is to make sure the specweb configuration files are setup
for php and not jsp, which Ill cover among other things in a later section of this guide.

Comments:

Post a Comment:
Comments are closed for this entry.

Archives
Links
Referrers