Setting up PHP on Sun Java System Web 7
Setting up PHP on Sun Web 7 is really simple. My small sized Accelerator has no issues running it, only that I had to tune down the threading and make sure the admin server is disabled when you are not using it because it takes up around 200MB of memory. So before you go running anything, I’d recommend clicking through the admin web console and disabling things that aren’t needed: webdav, java, check thread pools, check caching.
There are a few different ways you can run PHP on Sun Java System Web. NSAPI, Fastcgi, and Cgi. Each one has pros and cons explained here. In this config, I use the NSAPI plugin.
To get started download the PHP Plugin pack and extract it in your webserver7/plugins directory. The PHP pack comes already compiled with MySQL and PostgreSQL support. Here’s the steps:
# cd /opt/webserver7/plugins
# gzip -dc phppack-5_2_0-solaris-amd64.zip | tar xvf -
# cp php/php.ini-recommended php/php.ini
Add these lines to your magnus.conf file:
Init fn=”load-modules” shlib=”libphp5.so” funcs=”php5_init,php5_close,php5_execute,php5_auth_trans”
Init fn=”php5_init” errorString=”PHP Initialization Failed!”
In your https-server-name/config/obj.conf under Object name=”default” section, add:
* There may be more than one file with obj.conf, to find out which one you are using you can use the wadm command line: webserver7/bin/wadm get-virtual-server-prop –user=admin –config=server-name –vs=server-name object-file
Service type=”magnus-internal/php” fn=”php5_execute”
Also in the obj.conf, modify your PathCheck to include index.php
Finally, add the mime type to https-server-name/config/mime.types:
type=magnus-internal/php exts=php,php3,php4,php5
and now restart your web instance for changes to take effect. You should see something like this when it starts:
info: php5_init reports: Initialized PHP Module (20 threads exspected)
If you have any issues, check the README in the plugins/php dir, it has troubleshooting information.