goba            Sat Jun  5 16:16:07 2004 EDT

  Added files:                 
    /phpdoc/en/install/windows  sun.xml 

  Modified files:              
    /phpdoc/en/install/windows  index.xml 
  Log:
  Halleluja, this server had a long history, but it is still well alive, let's see:
  
   - Netscape Enterprise Server became iPlanet Server
   - iPlanet was integrated into Sun, and then rebraneded Sun ONE Web Server
   - finally Sun ONE Web Server was rebranded as Sun Java System Web Server
   - who knows what comes next?
  
  Naming IDs after Sun, and listing the server names in historically descending order.
  By the way it seems that those three sections I was talking about are quite
  operating system independet, so it would be nice to come up with some good idea on
  storing them at one place (we cannot make a snipet out of these three sections,
  since we would need a valid root tag for that XML file, and there is no such
  possibility here (except if we merge the three sections into one sect2 somehow).
  Ideas are welcome.
  
http://cvs.php.net/diff.php/phpdoc/en/install/windows/index.xml?r1=1.5&r2=1.6&ty=u
Index: phpdoc/en/install/windows/index.xml
diff -u phpdoc/en/install/windows/index.xml:1.5 phpdoc/en/install/windows/index.xml:1.6
--- phpdoc/en/install/windows/index.xml:1.5     Fri Jun  4 17:51:43 2004
+++ phpdoc/en/install/windows/index.xml Sat Jun  5 16:16:07 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
   <chapter id="install.windows">
    <title>Installation on Windows systems</title>
    <para>
@@ -30,7 +30,7 @@
    &install.windows.iis;
    &install.windows.apache1;
    &install.windows.apache2;
-   &install.windows.iplanet;
+   &install.windows.sun;
    &install.windows.omnihttpd;
    &install.windows.sambar;
    &install.windows.xitami;

http://cvs.php.net/co.php/phpdoc/en/install/windows/sun.xml?r=1.1&p=1
Index: phpdoc/en/install/windows/sun.xml
+++ phpdoc/en/install/windows/sun.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
  <sect1 id="install.windows.sun">
   <title>Sun, iPlanet and Netscape servers on Microsoft Windows</title>
   <para>
    This section contains notes and hints specific to Sun Java System Web Server,
    Sun ONE Web Server, iPlanet and Netscape server installs of PHP on
    <link linkend="install.sun.windows">Windows</link>.
   </para>
   <para>
    From PHP 4.3.3 on you can use PHP scripts with the
    <link linkend="ref.nsapi">NSAPI module</link> to 
    <link linkend="install.windows.sun.specialpages">generate custom
    directory listings and error pages</link>. Additional functions for
    Apache compatibility are also available. For support in current webservers
    read the <link linkend="install.windows.sun.notes">note about
    subrequests</link>.
   </para>
   
   <sect2 id="install.windows.sun.cgi">
    <title>CGI setup on Sun, iPlanet and Netscape servers</title> 
    <para>
     To install PHP as a CGI handler, do the following:
    </para>
    <itemizedlist>
     <listitem>
      <simpara>
       Copy <filename>php4ts.dll</filename> to your systemroot
       (the directory where you installed Windows)
      </simpara>
     </listitem>
     <listitem>
      <para>
       Make a file association from the command line.
       Type the following two lines:
       <programlisting role="shell">
<![CDATA[
assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*
]]>
       </programlisting>
      </para>
     </listitem>
     <listitem>
      <simpara>
       In the Netscape Enterprise Administration Server create
       a dummy shellcgi directory and remove it just after (this
       step creates 5 important lines in obj.conf and allow the
       web server to handle shellcgi scripts).
      </simpara>
     </listitem>
     <listitem>
      <simpara>
       In the Netscape Enterprise Administration Server create
       a new mime type (Category: type,
       Content-Type: magnus-internal/shellcgi, File Suffix:php).
      </simpara>
     </listitem>
     <listitem>
      <simpara>
       Do it for each web server instance you want PHP to run
      </simpara>
     </listitem>
    </itemizedlist>
    <para>
     More details about setting up
     PHP as a CGI executable can be found here:
     <ulink url="&url.netscape.cgi;">&url.netscape.cgi;</ulink>
    </para>
   </sect2>
    
   <sect2 id="install.windows.sun.nsapi">
    <title>NSAPI setup on Sun, iPlanet and Netscape servers</title> 
    <para>
     To install PHP with NSAPI, do the following:
    </para>
    <itemizedlist>
     <listitem>
      <simpara>
       Copy <filename>php4ts.dll</filename> to your systemroot
       (the directory where you installed Windows)
      </simpara>
     </listitem>
     <listitem>
      <para>
       Make a file association from the command line.
       Type the following two lines:
       <programlisting role="shell">
<![CDATA[
assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*
]]>
       </programlisting>
      </para>
     </listitem>
     <listitem>
      <simpara>
       In the Netscape Enterprise Administration Server create
       a new mime type (Category: type,
       Content-Type: magnus-internal/x-httpd-php, File Suffix: php).
      </simpara>
     </listitem>
     <listitem>
      <para>
        Edit <filename>magnus.conf</filename> (for servers &gt;= 6) or
        <filename>obj.conf</filename> (for servers &lt; 6) and add the following:
        You should
        place the lines after <literal>mime types init</literal>.
       <programlisting>
<![CDATA[
Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" 
shlib="c:/php/sapi/php4nsapi.dll"
Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" 
[php_ini="c:/path/to/php.ini"]
]]>
       </programlisting>
       (PHP &gt;= 4.3.3) The <literal>php_ini</literal> parameter is
       optional but with it you can place your
       &php.ini; in your webserver config directory.
      </para>
     </listitem>
     <listitem>
      <para>
       Configure the default object in <filename>obj.conf</filename>
       (for virtual server classes [Sun Web Server 6.0+] in
       their <filename>vserver.obj.conf</filename>):
       In the <literal>&lt;Object name="default"&gt;</literal>
       section, place this line necessarily after all 'ObjectType'
       and before all 'AddLog' lines:
       <programlisting>
<![CDATA[
Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value 
inikey=value ...]
]]>
       </programlisting>
       (PHP &gt;= 4.3.3) As additional parameters you can add some special
       &php.ini;-values, for example you
       can set a <literal>docroot=&quot;/path/to/docroot&quot;</literal>
       specific to the context <literal>php4_execute</literal>
       is called. For boolean ini-keys please use 0/1 as value,
       not <literal>&quot;On&quot;,&quot;Off&quot;,...</literal>
       (this will not work correctly), e.g.
       <literal>zlib.output_compression=1</literal> instead of
       <literal>zlib.output_compression=&quot;On&quot;</literal>
      </para>
     </listitem>
     <listitem>
      <para>
       This is only needed if you want to configure a directory that only consists of
       PHP scripts (same like a cgi-bin directory):
       <programlisting>
<![CDATA[
<Object name="x-httpd-php">
ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
Service fn=php4_execute [inikey=value inikey=value ...]
</Object>
]]>
       </programlisting>
       After that you can configure a directory in the Administration server and 
assign it
       the style <literal>x-httpd-php</literal>. All files in it will get executed as 
PHP.
       This is nice to hide PHP usage by renaming files to <filename>.html</filename>.
      </para>
     </listitem>
     <listitem>
      <simpara>
       Restart your web service and apply changes
      </simpara>
     </listitem>
     <listitem>
      <simpara>
       Do it for each web server instance you want PHP to run
      </simpara>
     </listitem>
    </itemizedlist>
    <note>
     <para>
      More details about setting up
      PHP as an NSAPI filter can be found here:
      <ulink url="&url.netscape.nsapi;">&url.netscape.nsapi;</ulink>
     </para>
    </note>
    <note>
     <para>
      The stacksize that PHP uses depends on the configuration of the webserver. If 
you get
      crashes with very large PHP scripts, it is recommended to raise it with the 
Admin Server
      (in the section &quot;MAGNUS EDITOR&quot;).
     </para>
    </note>
   </sect2>
   
   <sect2 id="install.windows.sun.phpini">
    <title>CGI environment and recommended modifications in php.ini</title>
    <para>
     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 webserver
     itself) 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 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>, etc., you should turn
     on <literal>register_globals</literal> in &php.ini; and change the variable
     order too (important: remove <literal>&quot;E&quot;</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.windows.sun.specialpages">
    <title>Special use for error pages or self-made directory listings (PHP &gt;= 
4.3.3)</title>
    <para>
     You can use PHP to generate the error pages for <literal>"404 Not Found"</literal>
     or similar. Add the following line to the object in <filename>obj.conf</filename> 
for
     every error page you want to overwrite:
     <programlisting>
<![CDATA[
Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value 
inikey=value...]
]]>
     </programlisting>
     where <literal>XXX</literal> is the HTTP error code. Please delete
     any other <literal>Error</literal> directives which could interfere with yours.
     If you want to place a page for all errors that could exist, leave
     the <literal>code</literal> parameter out. Your script can get the HTTP status 
code
     with <literal>$_SERVER['ERROR_TYPE']</literal>.
    </para>
    <para>
     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
     <literal>type=&quot;magnus-internal/directory&quot;</literal>
     in <filename>obj.conf</filename> with the following:
     <programlisting>
<![CDATA[
Service fn="php4_execute" type="magnus-internal/directory" 
script="/path/to/script.php" [inikey=value inikey=value...]
]]>
     </programlisting>
     For both error and directory listing pages the original URI and
     translated URI are in the variables <literal>$_SERVER['PATH_INFO']</literal> and
     <literal>$_SERVER['PATH_TRANSLATED']</literal>.
    </para>
   </sect2>
   
   <sect2 id="install.windows.sun.notes">
    <title>Note about <function>nsapi_virtual</function> and subrequests (PHP &gt;= 
4.3.3)</title>
    <para>
     The NSAPI module now supports the <function>nsapi_virtual</function> function
     (alias: <function>virtual</function>)
     to make subrequests on the webserver and insert the result in the webpage.
     The problem is, that this function uses some undocumented features from
     the NSAPI library.
    </para>
    <para>
     Under Unix this is not a problem, because the module automatically looks
     for the needed functions and uses them if available.
     If not, <function>nsapi_virtual</function> is disabled.
    </para>
    <para>
     Under Windows limitations in the DLL handling need the use of a automatic
     detection of the most recent <filename>ns-httpdXX.dll</filename> file.
     This is tested for servers till version 6.1. If a newer version of the
     Sun server is used, the detection fails and <function>nsapi_virtual</function>
     is disabled.
    </para>
    <para>
     If this is the case, try the following:
     Add the following parameter to <literal>php4_init</literal> in
     <filename>magnus.conf</filename>/<filename>obj.conf</filename>:
     <programlisting>
<![CDATA[
Init fn=php4_init ... server_lib="ns-httpdXX.dll"
]]>
     </programlisting>
     where <literal>XX</literal> is the correct DLL version number.
     To get it, look in the server-root for the correct DLL name. The
     DLL with the biggest filesize is the right one.
    </para>
    <para>
     You can check the status by using the <function>phpinfo</function> function.
    </para>
    <note>
     <para>
      But be warned: Support for <function>nsapi_virtual</function> is EXPERIMENTAL!!!
     </para>
    </note>
   </sect2>   
  </sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

Reply via email to