mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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
This commit is contained in:
parent
9a9ca4c419
commit
90b4d13d36
1 changed files with 37 additions and 1 deletions
|
@ -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>
|
||||
|
@ -367,6 +367,42 @@ Service fn=php4_execute [inikey=value inikey=value ...]
|
|||
<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">
|
||||
<title>Special use for error pages or self-made directory listings (PHP >= 4.3.3)</title>
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue