From 90b4d13d36aecb61359a77850c9f200ae5f606d8 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 22 Sep 2003 14:58:53 +0000 Subject: [PATCH] Addes some hints for proper using $_SERVER and not the environment because iPlanet is a multithreaded webserver without proper CGI environments. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@140865 c90b9560-bf6c-de11-be94-00142212c4b1 --- chapters/install.iplanet.xml | 38 +++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/chapters/install.iplanet.xml b/chapters/install.iplanet.xml index 8601a491cb..65e088ab87 100644 --- a/chapters/install.iplanet.xml +++ b/chapters/install.iplanet.xml @@ -1,5 +1,5 @@ - + Servers-Netscape, iPlanet and SunONE @@ -367,6 +367,42 @@ Service fn=php4_execute [inikey=value inikey=value ...] &url.netscape.nsapi; + + CGI environment and recommended modifications in php.ini + + Important when writing PHP scripts is the fact that iPlanet/SunONE/Netscape is a multithreaded web server. + Because of that all requests are running in the same process space (the space of the webserver itsself) and + this space has only one environment. If you want to get CGI variables like PATH_INFO, + HTTP_HOST etc. it is not the correct way to try this in the old PHP 3.x way with + getenv or a similar way (register globals to environment, $_ENV). + You would only get the environment of the running webserver without any valid CGI variables! + + + + Why are there (invalid) CGI variables in the environment? + + + Answer: This is because you started the webserver process from the admin server which runs the startup + script of the webserver, you wanted to start, as a CGI script + (a CGI script inside of the admin server!). This is why the environment of the started webserver + has some CGI environment variables in it. You can test this by + starting the webserver not from the administration server. Use the unix 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 + $_SERVER. If you have older scripts which use $HTTP_HOST,..., + you should turn on register_globals in &php.ini; and change the variable order + to (important: remove "E" from it, because you do not need the environment here): + + + + + Special use for error pages or self-made directory listings (PHP >= 4.3.3)