thetaphi Mon Sep 22 10:58:53 2003 EDT
Modified files: /phpdoc/en/chapters install.iplanet.xml Log: Addes some hints for proper using $_SERVER and not the environment because iPlanet is a multithreaded webserver without proper CGI environments. Index: phpdoc/en/chapters/install.iplanet.xml diff -u phpdoc/en/chapters/install.iplanet.xml:1.7 phpdoc/en/chapters/install.iplanet.xml:1.8 --- phpdoc/en/chapters/install.iplanet.xml:1.7 Sun Aug 17 18:15:07 2003 +++ phpdoc/en/chapters/install.iplanet.xml Mon Sep 22 10:58:53 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <sect1 id="install.netscape-enterprise"> <title>Servers-Netscape, iPlanet and SunONE</title> <para> @@ -365,6 +365,42 @@ More details about setting up PHP as an NSAPI filter can be found here: <ulink url="&url.netscape.nsapi;">&url.netscape.nsapi;</ulink> + </para> + </sect2> + <sect2 id="install.netscape.phpini"> + <title>CGI environment and recommended modifications in php.ini</title> + <para> + 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 <literal>PATH_INFO</literal>, + <literal>HTTP_HOST</literal> etc. it is not the correct way to try this in the old PHP 3.x way with + <function>getenv</function> or a similar way (register globals to environment, <literal>$_ENV</literal>). + You would only get the environment of the running webserver without any valid CGI variables! + </para> + <note> + <para> + Why are there (invalid) CGI variables in the environment? + </para> + <para> + 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. + </para> + </note> + <para> + Simply change your scripts to get CGI variables in the correct way for PHP 4.x by using the superglobal + <literal>$_SERVER</literal>. If you have older scripts which use <literal>$HTTP_HOST</literal>,..., + you should turn on <literal>register_globals</literal> in &php.ini; and change the variable order + to (important: remove <literal>"E"</literal> from it, because you do not need the environment here): + <programlisting> +<![CDATA[ +variables_order = "GPCS" +register_globals = On +]]> + </programlisting> </para> </sect2> <sect2 id="install.netscape.specialpages">