Home   |   Products   |   Order   |   Support   |   ? !1 UK Web Hosting
 

The PHP4 CGI
There are two different ways to install PHP4 on a Virtual Server. The best way is to install the mod_php4 Apache Module. It can also be installed as a CGI to which PHP4 files are redirected by your Virtual Server web server.

Installation
Connect to your Virtual Server via Telnet or SSH and do the following.

  1. Install the PHP4 CGI by doing the following, according to your Virtual Server O/S:

    • FreeBSD & Solaris PHP 4.0.4
      Run the following command, substituting a version of PHP4 for PHP4_VERSION:

      % vinstall PHP4_VERSION
      

      These versions of PHP4 are available:

      php4     php4-mysql     php4-pgsql     php4-msql
      

    • BSD/OS Upgrade!
      PHP4 is unavailable. Try PHP3.

    • Huh?
      If you don't know the Virtual Server O/S, try the following:

  2. Due to Security Issues the PHP4 CGI is installed at ~/usr/local/bin/php. Do the following to link the PHP4 CGI into your ~/www/cgi-bin directory.

    % cd ~/www/cgi-bin
    % ln ../../../bin/php php
    

  3. Make the following additions and modifications to your Virtual Server web server configuration file (~/www/conf/httpd.conf).

    NOTE: If your Virtual Server was configured before Dec 8, 1998 you will need to make the following additions and modifications in the ~/www/conf/srm.conf file instead. Then, Restart Your Web Server.

    1. Modify the DirectoryIndex line so that PHP4 files will be included as directory indices.

      DirectoryIndex index.php index.php4 index.php3 index.cgi index.html index.htm
      

    2. Add the following lines so that all files with .php, .php3, .php4, and .phtml extensions will be redirected to the PHP4 CGI executable.

      Action     php4-script /cgi-bin/php
      AddHandler php4-script .php .php3 .php4 .phtml
      

  4. To test your PHP installation, try creating the following ~/www/htdocs/test.php4 document and viewing it in your web browser.

    <HTML>
    <BODY>
    <?php
    phpinfo();
    ?>
    </BODY>
    </HTML>
    

    The phpinfo() function reports the version number, as well as the features that are compiled into PHP.


Site Map  |  Contact Us!
Copyright © 1998-2001 Bright Builders, Inc. All rights reserved.
Last Modified: Wed Mar 28 21:42:08 2001 GMT
Page Built: Mon Jul 2 19:58:04 2001 GMT

   
A L S O  S E E
· Virtual Server Help