|
Sun, iPlanet and Netscape servers on Microsoft WindowsThis section contains notes and hints specific to Sun Java System Web Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP on Windows. From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to generate custom directory listings and error pages. Additional functions for Apache compatibility are also available. For support in current web servers read the note about subrequests. To install PHP as a CGI handler, do the following:
More details about setting up PHP as a CGI executable can be found here: » http://benoit.noss.free.fr/php/install-php.php To install PHP with NSAPI, do the following:
Note:
More details about setting up PHP as an NSAPI filter can be found here: » http://benoit.noss.free.fr/php/install-php4.php
Note:
The stacksize that PHP uses depends on the configuration of the web server. If you get crashes with very large PHP scripts, it is recommended to raise it with the Admin Server (in the section "MAGNUS EDITOR").
Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
WS/iPlanet/Netscape is a multithreaded web server. Because of that all
requests are running in the same process space (the space of the web server
itself) and this space has only one environment. If you want to get CGI
variables like
Note:
Why are there (invalid) CGI variables in the environment? Answer: This is because you started the web server process from the admin server which runs the startup script of the web server, you wanted to start, as a CGI script (a CGI script inside of the admin server!). This is why the environment of the started web server has some CGI environment variables in it. You can test this by starting the web server not from the administration server. Use the command line as root user and start it manually - you will see there are no CGI-like environment variables.
Simply change your scripts to get CGI variables in the correct way for
PHP 4.x by using the superglobal variables_order = "GPCS"
You can use PHP to generate the error pages for Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...]
where
Another possibility is to generate self-made directory listings.
Just create a PHP script which displays a directory listing and
replace the corresponding default Service line for
Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...]
For both error and directory listing pages the original URI and
translated URI are in the variables Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)The NSAPI module now supports the nsapi_virtual() function (alias: virtual()) to make subrequests on the web server and insert the result in the web page. The problem is, that this function uses some undocumented features from the NSAPI library. Under Unix this is not a problem, because the module automatically looks for the needed functions and uses them if available. If not, nsapi_virtual() is disabled.
Under Windows limitations in the DLL handling need the use of a automatic
detection of the most recent
If this is the case, try the following:
Add the following parameter to Init fn=php4_init ... server_lib="ns-httpdXX.dll"
where You can check the status by using the phpinfo() function.
Note:
But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!! |