Support
 
 

The mod_php4 Apache Module
There are several different ways to install PHP4 on a Virtual Private Server. The best way is to install the mod_php4 Apache Module. Another less desirable method is to install The PHP4 CGI to which PHP4 files are redirected by your web server.

NOTE: PHP no longer creates GIF images via lib-gd. Due to patent restrictions on the GIF compression algorithm we can no longer support it. The PNG Image Format has support for alpha channels, gamma correction, has better compression than GIF compression and supports 48-bit color depth (versus 8-bit color GIF images), and is now widely supported by nearly all modern web browsers.

NOTE: The PHP4 Apache module installation does not include a PHP configuration file (php.ini). Only the CGI installation includes the configuration file.


NOTE: With the release of PHP4.2.2, one of the default settings has been changed. This has been found to affect several commonly used scripts, including TWIG. If you are using TWIG or are having trouble with scripts that worked without problems prior to upgrading to version 4.2.2, create a file named php.ini in the ~/usr/local/lib/ directory of your Virtual Private Server. The php.ini file needs to contain at least this line:

register_globals = On

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

  1. Install the PHP4 Apache modules. Follow the directions that correspond to your Virtual Private Server O/S.

    • FreeBSD & Solaris [PHP 4.2.2]
      Run the following command:

      % vinstall php4-dso

      NOTE: Any version of PHP prior to 4.2.2 has a known security vulnerability which can compromise your Virtual Private Server. If you are using PHP4.1.2 or earlier, we strongly encourage you to upgrade to version 4.2.2.


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

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


  2. Configure your web server to dynamically load the PHP4 Apache module. Add the following line to the top of your web server configuration file (~/www/conf/httpd.conf). Substitute the file name of the Apache module you want to install for FILE-NAME.

    LoadModule php4_module modules/FILE-NAME

    These PHP4 modules are available:

    No database support
    mod_php4-4.2.2-module.so
    mod_php4-4.2.2-module-ftp-imap-freetype-gd.so
    mod_php4-4.2.2-module-imap.so
    mod_php4-4.2.2-module-mcrypt-freetype-gd.so
    mod_php4-4.2.2-module-mcrypt-ftp-imap-zlib-freetype-gd-curl-dom.so
    mod_php4-4.2.2-module-mcrypt-ftp-imap.so
    
    mSQL database support
    mod_php4-4.2.2-module-msql-ftp-imap-freetype-gd.so
    mod_php4-4.2.2-module-msql-imap.so
    mod_php4-4.2.2-module-msql-mcrypt-freetype-gd.so
    mod_php4-4.2.2-module-msql-mcrypt-ftp-imap.so
    mod_php4-4.2.2-module-msql-mcrypt-ftp-zlib-imap-freetype-curl-gd-dom.so
    mod_php4-4.2.2-module-msql.so
    
    MySQL database support
    mod_php4-4.2.2-module-mysql-ftp-imap-freetype-gd.so
    mod_php4-4.2.2-module-mysql-imap.so
    mod_php4-4.2.2-module-mysql-mcrypt-freetype-gd.so
    mod_php4-4.2.2-module-mysql-mcrypt-ftp-imap.so
    mod_php4-4.2.2-module-mysql-mcrypt-ftp-zlib-imap-freetype-curl-gd-dom.so
    mod_php4-4.2.2-module-mysql.so
    
    PostgreSQL database support
    mod_php4-4.2.2-module-pgsql-ftp-imap-freetype-gd.so
    mod_php4-4.2.2-module-pgsql-imap.so
    mod_php4-4.2.2-module-pgsql-mcrypt-freetype-gd.so
    mod_php4-4.2.2-module-pgsql-mcrypt-ftp-imap.so
    mod_php4-4.2.2-module-pgsql-mcrypt-ftp-zlib-imap-freetype-curl-gd-dom.so
    mod_php4-4.2.2-module-pgsql.so
          
  3. Make the following additions and modifications to your web server configuration file (~/www/conf/httpd.conf).

    NOTE: If your Virtual Private 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 Apache module.

      AddType application/x-httpd-php .php .php3 .php4 .phtml
      AddType application/x-httpd-php-source .phps
              
  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.