Installing PHP4 under WindowsNT/Unix
as NSAPI for Netscape Enterprise Server
or for iPlanet

click here if you want the CGI installation page
click here if you don't know the difference between NSAPI and CGI

1st step : Installing PHP on the WindowsNT server (NT users only)

  1. Copy the php files on your server (I downloaded PHP4.0.4 from the PHP WebSite)
  2. Edit php.ini-dist and rename php.ini-dist to php.ini
  3. Make a file association under Windows NT
  4. Test the 1st step

2nd step : Configuring Netscape Enterprise Server or iPlanet for PHP4 with nsapi (NT & UNIX)

  1. Compile PHP (UNIX users only)
  2. Add a mime-type to the Netscape Server
  3. Stop your Web Server
  4. Make a copy of obj.conf located in: <path-to-netscape-server>/https-servername/config
  5. Modify obj.conf
  6. Restart your Web Server

Where to get more information

  1. The PHP site
  2. The nsapi-readme.txt

1st step : Installing PHP on the WindowsNT server (NT users only)

  1. Copy the php files on your server

  2. Edit php.ini-dist
  3. Make a file association under Windows NT
  4. Test the 1st step
    1. Create a C:\test.php file with a single line like
      <? echo("Nothing to write"); ?>
    2. Create a C:\test.bat file with 2 lines
      test.php
      pause
    3. double-clic on test.bat
    4. If you see something like
      X-Powered-By: PHP/4.0.3
      Content-type: text/html
       
      Nothing to write
      then the NT association works!!

2nd step : Configuring Netscape Enterprise Server or iPlanet for PHP4 with nsapi (NT & UNIX)

    1. Unix users only
      Compile PHP as follows:
      ./configure --with-nsapi=/usr/local/netscape/server4 --enable-libgcc
      make
      make install
      Add LD_LIBRARY_PATH=<libdir> to your Netscape server startup script
      where <libdir> is the full path to the directory where libstdc++.so.2.10.0 is located (usually /usr/local/lib)
    2. Add a mime-type to the Netscape Server
      In the Netscape Administration console chose Preferences|Mime Types
      Add a new type called magnus-internal/x-httpd-php for exts=php
      Click here for screenshot
    3. Stop your Web Server
    4. Make a copy of obj.conf located in: <path-to-netscape-server>/https-servername/config
    5. Modify obj.conf
      1. There are several section in obj.conf
      2. At the end of the Init section of obj.conf (necessarely after mime type init),
        place this two lines
        For NT users
        Init fn="load-modules" funcs="php4_init,php4_close,php4_execute,php4_auth_trans" shlib="d:/php4/sapi/php4nsapi.dll"
        Init fn="php4_init" errorString="Failed to initialise PHP!"
        For Unix users
        Init fn="load-modules" funcs="php4_init,php4_close,php4_execute,php4_auth_trans" shlib="/usr/local/netscape/server4/bin/libphp4.so"
        Init fn="php4_init" errorString="Failed to initialise PHP!"
      3. In The < Object name="default" > section,
        place this line (necessarely after all 'ObjectType' and before all 'AddLog' lines)
        Service fn="php4_execute" type="magnus-internal/x-httpd-php"
      4. Add a new object called x-httpd-php
        <Object name="x-httpd-php">
        ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
        Service fn=php4_execute
        </Object>
    6. Restart your Web Server
  1. Test the 2nd step
    1. Put the test.php file in the document root of your server
    2. Then type http://server/test.php
    If you can see "nothing to write" in your browser then it works!

Where to get more information

  1. The PHP documentation
  2. nsapi-readme.txt
  3. NSAPI or CGI ?
  4. ShellCGI directory or CGI as a filetype
Don't hesitate sending me feedback or questions
Special thanks to Daniel Beulshausen, Alfred Lerch (Unix Part),Matthias Kramer