Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 8228

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sun, iPlanet and Netscape servers on Sun Solaris</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.unix.lighttpd-14.html">Lighttpd 1.4 on Unix systems</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.unix.commandline.html">CGI and command line setups</a></div>
 <div class="up"><a href="install.unix.html">Installation on Unix systems</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="install.unix.sun" class="sect1">
    <h2 class="title">Sun, iPlanet and Netscape servers on Sun Solaris</h2>
    <p class="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 Sun Solaris.
    </p>
    <p class="para">
     From PHP 4.3.3 on you can use PHP scripts with the
     <a href="ref.nsapi.html" class="link">NSAPI module</a> to 
     <a href="install.unix.sun.html#install.unix.sun.specialpages" class="link">generate custom directory
     listings and error pages</a>. Additional functions for Apache
     compatibility are also available. For support in current web servers read
     the <a href="install.unix.sun.html#install.unix.sun.notes" class="link">note about subrequests</a>.
    </p>
    <p class="para">
     You can find more information about setting up PHP for the Netscape
     Enterprise Server (NES) here:
     <a href="http://benoit.noss.free.fr/php/install-php4.html" class="link external">&raquo;&nbsp;http://benoit.noss.free.fr/php/install-php4.html</a>
    </p>
    
    <p class="para">
     To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
     enter the proper install directory for the
     <a href="configure.about.html#configure.with-nsapi" class="link">--with-nsapi=[DIR]</a>
     option. The default directory is usually
     <var class="filename">/opt/netscape/suitespot/</var>.
     Please also read <var class="filename">/php-xxx-version/sapi/nsapi/nsapi-readme.txt</var>.
    </p>
    <p class="para">
     <ol type="1">
      <li class="listitem">
       <p class="para">
        Install the following packages from <a href="http://www.sunfreeware.com/" class="link external">&raquo;&nbsp;
        http://www.sunfreeware.com/</a> or another download site:
        <ul class="simplelist">
         <li class="member"><var class="filename">autoconf-2.13</var></li>
         <li class="member"><var class="filename">automake-1.4</var></li>
         <li class="member"><var class="filename">bison-1_25-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">flex-2_5_4a-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">gcc-2_95_2-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">gzip-1.2.4-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">m4-1_4-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">make-3_76_1-sol26-sparc-local</var></li>
         <li class="member">
          <var class="filename">mysql-3.23.24-beta</var> (if you want mysql support)
         </li>
         <li class="member"><var class="filename">perl-5_005_03-sol26-sparc-local</var></li>
         <li class="member"><var class="filename">tar-1.13</var> (GNU tar)</li>
        </ul>
       </p>
      </li>
      <li class="listitem">
       <span class="simpara">
        Make sure your path includes the proper directories
        <em>PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin</em>
        and make it available to your system <strong class="userinput"><code>export PATH</code></strong>.
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        <strong class="userinput"><code>gunzip php-x.x.x.tar.gz</code></strong> (if you have a <var class="filename">.gz</var> dist,
        otherwise go to 4).
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        <strong class="userinput"><code>tar xvf php-x.x.x.tar</code></strong>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        Change to your extracted PHP directory:
        <strong class="userinput"><code>cd ../php-x.x.x</code></strong>
       </span>
      </li>
      <li class="listitem">
       <p class="para">
        For the following step, make sure
        <var class="filename">/opt/netscape/suitespot/</var> is
        where your netscape server is installed. Otherwise, change to the
        correct path and run:
        <div class="example-contents">
<div class="shellcode"><pre class="shellcode">./configure --with-mysql=/usr/local/mysql \
--with-nsapi=/opt/netscape/suitespot/ \
--enable-libgcc</pre>
</div>
        </div>

       </p>
      </li>
      <li class="listitem">
       <span class="simpara">
        Run <strong class="command">make</strong> followed by <strong class="command">make install</strong>.
       </span>
      </li>
     </ol>
    </p>
    <p class="para">
     After performing the base install and reading the appropriate readme file,
     you may need to perform some additional configuration steps.
    </p>
    <p class="formalpara">
     <h5 class="title">Configuration Instructions for Sun/iPlanet/Netscape</h5>
     <p class="para">
      Firstly you may need to add some paths to the <var class="varname"><var class="varname">LD_LIBRARY_PATH</var></var>
      environment for the server to find all the shared libs. This can best done
      in the start script for your web server. The start script is often located
      in: <var class="filename">/path/to/server/https-servername/start</var>.
      You may also need to edit the configuration files that are
      located in: <var class="filename">/path/to/server/https-servername/config/</var>.
      <ol type="1">
       <li class="listitem">
        <p class="para">
         Add the following line to <var class="filename">mime.types</var> (you can do
         that by the administration server):
         <div class="example-contents screen">
<div class="cdata"><pre>
type=magnus-internal/x-httpd-php exts=php
</pre></div>
         </div>
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         Edit <var class="filename">magnus.conf</var> (for servers &gt;= 6) or
         <var class="filename">obj.conf</var> (for servers &lt; 6) and add the following,
         shlib will vary depending on your system, it will be something like
         <var class="filename">/opt/netscape/suitespot/bin/libphp4.so</var>. You should
         place the following lines after <em>mime types init</em>.
         <div class="example-contents">
<div class="cdata"><pre>
Init fn=&quot;load-modules&quot; funcs=&quot;php4_init,php4_execute,php4_auth_trans&quot; shlib=&quot;/opt/netscape/suitespot/bin/libphp4.so&quot;
Init fn=&quot;php4_init&quot; LateInit=&quot;yes&quot; errorString=&quot;Failed to initialize PHP!&quot; [php_ini=&quot;/path/to/php.ini&quot;]
</pre></div>
         </div>

         (PHP &gt;= 4.3.3) The <em>php_ini</em> parameter is
         optional but with it you can place your <var class="filename">php.ini</var> in your
         web server config directory.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         Configure the default object in <var class="filename">obj.conf</var>
         (for virtual server classes [version 6.0+] in
         their <var class="filename">vserver.obj.conf</var>):
         <div class="example-contents">
<div class="cdata"><pre>
&lt;Object name=&quot;default&quot;&gt;
.
.
.
.#NOTE this next line should happen after all &#039;ObjectType&#039; and before all &#039;AddLog&#039; lines
Service fn=&quot;php4_execute&quot; type=&quot;magnus-internal/x-httpd-php&quot; [inikey=value inikey=value ...]
.
.
&lt;/Object&gt;
</pre></div>
         </div>

         (PHP &gt;= 4.3.3) As additional parameters you can add some special
         <var class="filename">php.ini</var>-values, for example you can set a
         <em>docroot=&quot;/path/to/docroot&quot;</em> specific
         to the context <em>php4_execute</em> is called. For boolean
         ini-keys please use 0/1 as value, not
         <em>&quot;On&quot;,&quot;Off&quot;,...</em>
         (this will not work correctly), e.g.
         <em>zlib.output_compression=1</em> instead of
         <em>zlib.output_compression=&quot;On&quot;</em>
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         This is only needed if you want to configure a directory that only consists of
         PHP scripts (same like a <var class="filename">cgi-bin</var> directory):
         <div class="example-contents">
<div class="cdata"><pre>
&lt;Object name=&quot;x-httpd-php&quot;&gt;
ObjectType fn=&quot;force-type&quot; type=&quot;magnus-internal/x-httpd-php&quot;
Service fn=php4_execute [inikey=value inikey=value ...]
&lt;/Object&gt;
</pre></div>
         </div>

         After that you can configure a directory in the Administration server and assign it
         the style <em>x-httpd-php</em>. All files in it will get executed as PHP.
         This is nice to hide PHP usage by renaming files to <var class="filename">.html</var>.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         Setup of authentication: PHP authentication cannot be used with any
         other authentication. ALL AUTHENTICATION IS PASSED TO YOUR PHP SCRIPT.
         To configure PHP Authentication for the entire server, add the
         following line to your default object:
         <div class="example-contents">
<div class="cdata"><pre>
&lt;Object name=&quot;default&quot;&gt;
AuthTrans fn=php4_auth_trans
.
.
.
&lt;/Object&gt;
</pre></div>
         </div>

        </p>
       </li>
       <li class="listitem">
        <p class="para">
         To use PHP Authentication on a single directory, add the following:
         <div class="example-contents">
<div class="cdata"><pre>
&lt;Object ppath=&quot;d:\path\to\authenticated\dir\*&quot;&gt;
AuthTrans fn=php4_auth_trans
&lt;/Object&gt;
</pre></div>
         </div>

        </p>
       </li>
      </ol>
     </p>
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      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 &quot;MAGNUS EDITOR&quot;).
     </p>
    </p></blockquote>
   
   <div class="sect2" id="install.unix.sun.phpini">
    <h3 class="title">CGI environment and recommended modifications in <var class="filename">php.ini</var></h3>
    <p class="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 web server
     itself) and this space has only one environment. If you want to get CGI
     variables like <em>PATH_INFO</em>, <em>HTTP_HOST</em>
     etc. it is not the correct way to try this in the old PHP way with
      <span class="function"><a href="function.getenv.html" class="function">getenv()</a></span> or a similar way (register globals to
     environment, <var class="varname"><var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV</a></var></var>). You would only get the environment
     of the running web server without any valid CGI variables!
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      Why are there (invalid) CGI variables in the environment?
     </p>
     <p class="para">
      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.
     </p>
    </p></blockquote>
    <p class="para">
     Simply change your scripts to get CGI variables in the correct way for
     PHP 4.x by using the superglobal <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER</a></var></var>. If you have
     older scripts which use <var class="varname"><var class="varname">$HTTP_HOST</var></var>, etc., you should turn
     on <em>register_globals</em> in <var class="filename">php.ini</var> and change the variable
     order too (important: remove <em>&quot;E&quot;</em> from it,
     because you do not need the environment here):
     <div class="example-contents">
<div class="cdata"><pre>
variables_order = &quot;GPCS&quot;
register_globals = On
</pre></div>
     </div>

    </p>
   </div>
   
   <div class="sect2" id="install.unix.sun.specialpages">
    <h3 class="title">Special use for error pages or self-made directory listings (PHP &gt;= 4.3.3)</h3>
    <p class="para">
     You can use PHP to generate the error pages for <em>&quot;404 Not Found&quot;</em>
     or similar. Add the following line to the object in <var class="filename">obj.conf</var> for
     every error page you want to overwrite:
     <div class="example-contents">
<div class="cdata"><pre>
Error fn=&quot;php4_execute&quot; code=XXX script=&quot;/path/to/script.php&quot; [inikey=value inikey=value...]
</pre></div>
     </div>

     where <em>XXX</em> is the HTTP error code. Please delete
     any other <em>Error</em> directives which could interfere with yours.
     If you want to place a page for all errors that could exist, leave
     the <em>code</em> parameter out. Your script can get the HTTP status code
     with <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['ERROR_TYPE']</a></var></var>.
    </p>
    <p class="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 <em>Service</em> line for
     <em>type=&quot;magnus-internal/directory&quot;</em>
     in <var class="filename">obj.conf</var> with the following:
     <div class="example-contents">
<div class="cdata"><pre>
Service fn=&quot;php4_execute&quot; type=&quot;magnus-internal/directory&quot; script=&quot;/path/to/script.php&quot; [inikey=value inikey=value...]
</pre></div>
     </div>

     For both error and directory listing pages the original URI and
     translated URI are in the variables <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['PATH_INFO']</a></var></var> and
     <var class="varname"><var class="varname"><a href="reserved.variables.server.html" class="classname">$_SERVER['PATH_TRANSLATED']</a></var></var>.
    </p>
   </div>
   
   <div class="sect2" id="install.unix.sun.notes">
    <h3 class="title">Note about  <span class="function"><a href="function.nsapi-virtual.html" class="function">nsapi_virtual()</a></span> and subrequests (PHP &gt;= 4.3.3)</h3>
    <p class="para">
     The NSAPI module now supports the  <span class="function"><a href="function.nsapi-virtual.html" class="function">nsapi_virtual()</a></span> function
     (alias:  <span class="function"><a href="function.virtual.html" class="function">virtual()</a></span>)
     to make subrequests on the web server and insert the result in the web page.
     This function uses some undocumented features from the NSAPI library.
     On Unix the module automatically looks for the needed functions and uses
     them if available. If not,  <span class="function"><a href="function.nsapi-virtual.html" class="function">nsapi_virtual()</a></span> is disabled.
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      But be warned: Support for  <span class="function"><a href="function.nsapi-virtual.html" class="function">nsapi_virtual()</a></span> is EXPERIMENTAL!!!
     </p>
    </p></blockquote>
   </div>   
  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.unix.lighttpd-14.html">Lighttpd 1.4 on Unix systems</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.unix.commandline.html">CGI and command line setups</a></div>
 <div class="up"><a href="install.unix.html">Installation on Unix systems</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>