Installing PHP4 or PHP3

 

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

NOTE: PHP4 has a large list of known bugs. Please consult the PHP Bug Reporting list if you are finding strange behavior from your PHP4 modules. Some of the more apparent bugs involve multiple file uploads, url rewriting during session handling, and occasional zombies using backtick execution. If any of your existing PHP3 applications rely on some of these features, be sure to test them before making a full commitment to PHP4.

Dynamic Module Installation
Connect to your Virtual Server via Telnet and do the following.

  1. Install the PHP4 dynamic modules on your Virtual Server.
    FreeBSD PHP 4.0.0
    % vinstall php4-dso
    
    BSD/OS PHP 4.X.X
    unavailable
    
    NOTE: If your Virtual Server was ordered after Nov 22, 1999, you are likely running FreeBSD. To find out which O/S your Virtual Server is running, use the uname command:
    % uname
    

    If your Virtual Server is not already running FreeBSD, Upgrade to a New FreeBSD Virtual Server today!

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

  2. Add the following line to the top of your Virtual Server web server configuration file (~/www/conf/httpd.conf) to dynamically load the PHP4 dynamic module. Substitute the name of the dynamic module you want to install for MODULE-NAME.
    LoadModule  php4_module  modules/MODULE-NAME
    

    Currently, these PHP4 dynamic modules are available.

    FreeBSD PHP 4.0.0
    No database support
    mod_php4-4.0.0-module.so
    mod_php4-4.0.0-module-imap.so
    mod_php4-4.0.0-module-ftp-imap-freetype-gd.so
    mod_php4-4.0.0-module-mcrypt-freetype-gd.so
    mod_php4-4.0.0-module-mcrypt-ftp-imap-freetype-gd-xml.so
    mod_php4-4.0.0-module-mcrypt-ftp-imap.so
    
    mSQL database support
    mod_php4-4.0.0-module-msql.so
    mod_php4-4.0.0-module-msql-imap.so
    mod_php4-4.0.0-module-msql-ftp-imap-freetype-gd.so
    mod_php4-4.0.0-module-msql-mcrypt-freetype-.so
    mod_php4-4.0.0-module-msql-mcrypt-ftp-imap-freetype-gd-xml.so
    mod_php4-4.0.0-module-msql-mcrypt-ftp-imap.so
    
    MySQL database support
    mod_php4-4.0.0-module-mysql.so
    mod_php4-4.0.0-module-mysql-imap.so
    mod_php4-4.0.0-module-mysql-ftp-imap-freetype-gd.so
    mod_php4-4.0.0-module-mysql-mcrypt-freetype-gd.so
    mod_php4-4.0.0-module-mysql-mcrypt-ftp-imap-freetype-gd-xml.so
    mod_php4-4.0.0-module-mysql-mcrypt-ftp-imap.so
    
    PostgreSQL database support
    mod_php4-4.0.0-module-pgsql.so
    mod_php4-4.0.0-module-pgsql-imap.so
    mod_php4-4.0.0-module-pgsql-ftp-imap-freetype-gd.so
    mod_php4-4.0.0-module-pgsql-mcrypt-freetype-gd.so
    mod_php4-4.0.0-module-pgsql-mcrypt-ftp-imap-freetype-gd-xml.so
    mod_php4-4.0.0-module-pgsql-mcrypt-ftp-imap.so
    
    BSD/OS PHP 4.X.X
    unavailable
    
  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 Virtual Server Web Server.
    1.  
    2. 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
      
    3. Add the following lines so that all files with .php, .php3, .php4, and .phtml extensions will be redirected to the PHP4 dynamic module.
      AddType application/x-httpd-php .php .php3 .php4
      AddType application/x-httpd-php-source .phps
      

      If you want to run PHP3 and PHP4 concurrently, add the following lines instead of those above.

      AddType application/x-httpd-php3 .php3
      AddType application/x-httpd-php .php .php4
      AddType application/x-httpd-php-source .phps
      



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

  1.  
  2. Install the PHP4 software. Use the commands below, depending upon your Virtual Server O/S to install the basic build of PHP4.
    FreeBSD PHP 4.0.0
    % vinstall php4
    
    BSD/OS PHP 4.X.X
    unavailable
    
    NOTE: If your Virtual Server was ordered after Nov 22, 1999, you are likely running FreeBSD. To find out which O/S your Virtual Server is running, use the uname command:
    % uname
    

    If your Virtual Server is not already running FreeBSD, Upgrade to a New FreeBSD Virtual Server today!

    We have made a number of PHP4 CGI builds available. To install a build with features that you want, use one of the following commands, instead of those above.

    FreeBSD PHP 4.0.0
    % vinstall php4
    % vinstall php4-msql
    % vinstall php4-mysql
    % vinstall php4-pgsql
    
    BSD/OS PHP 4.X.X
    unavailable
    

    The PHP4 configuration file will be created at ~/usr/local/lib/php.ini instead of ~/usr/local/lib/php3.ini as it was with previous versions of PHP3.

  3. 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
    
  4. 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 Virtual Server Web Server.
    1.  
    2. 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
      
    3. 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
      

     

 

 
 

Installing PHP3
There are two different ways to install PHP3 on a Virtual Server. The best way is to install it as a Dynamic Module. It can also be installed as a CGI to which PHP3 files are redirected by your Virtual Server web server.

Which Version of PHP3 Should You Choose?
Within each version of PHP3, there are several "builds" to choose from. A build consists of PHP3's core features--which are found in every build--and some optional additional features, such as database support, on-the-fly image creation, and encryption. You should choose the build that best suits your needs but at the same time does not add unnecessary overhead to your web server.

For example, if you plan on making use of PHP3 to transfer files between computers, or to use TWIG to access your email, you'll want to choose a PHP3 build that includes ftp, imap, and the database backend you're using for TWIG in the build name.

mod_php3-3.0.16-module-mysql-mcrypt-ftp-imap.so

If you want to use PHP3 chiefly to access a PostgreSQL database, but not build images on the fly, choose a PHP3 build with pgsql but without freetype and gd in the build name.

mod_php3-3.0.16-module-pgsql.so

By selecting the PHP3 build carefully, you will maximize your virtual server's memory use as well as improve the performance of your Apache Web Server.

Dynamic Module Installation
Connect to your Virtual Server via Telnet or SSH and do the following:

  1.  
  2. If your Virtual Server is running the FreeBSD O/S, then Upgrade Your Virtual Server Apache (if you aren't already running Apache 1.3). If your Virtual Server is running the BSD/OS, then skip to the next step.
    NOTE: If your Virtual Server was ordered after Nov 22, 1999, you are likely running FreeBSD. To find out which O/S your Virtual Server is running, use the uname command:
    % uname
    

    If your Virtual Server is not already running FreeBSD, Upgrade to a New FreeBSD Virtual Server today!

  3. Install the PHP3 dynamic module on your Virtual Server. Substitute the name of the dynamic module you want to install for MODULE-NAME below.
    FreeBSD PHP 3.0.16
    % cd /usr/local/apache/1.3/modules
    % ln MODULE-NAME ~/www/modules/MODULE-NAME
    
    BSD/OS PHP 3.0.12
    % cd /usr/local/apache/modules/1.2.6
    % ln MODULE-NAME ~/www/modules/MODULE-NAME
    

    Currently, these PHP3 dynamic modules are available.

    FreeBSD PHP 3.0.16
    No database support
    mod_php3-3.0.16-module.so
    mod_php3-3.0.16-module-imap.so
    mod_php3-3.0.16-module-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-mcrypt-freetype-gd.so
    mod_php3-3.0.16-module-mcrypt-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-mcrypt-ftp-imap.so
    
    mSQL database support
    mod_php3-3.0.16-module-msql.so
    mod_php3-3.0.16-module-msql-imap.so
    mod_php3-3.0.16-module-msql-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-msql-mcrypt-freetype-.so
    mod_php3-3.0.16-module-msql-mcrypt-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-msql-mcrypt-ftp-imap.so
    
    MySQL database support
    mod_php3-3.0.16-module-mysql.so
    mod_php3-3.0.16-module-mysql-imap.so
    mod_php3-3.0.16-module-mysql-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-mysql-mcrypt-freetype-gd.so
    mod_php3-3.0.16-module-mysql-mcrypt-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-mysql-mcrypt-ftp-imap.so
    
    PostgreSQL database support
    mod_php3-3.0.16-module-pgsql.so
    mod_php3-3.0.16-module-pgsql-imap.so
    mod_php3-3.0.16-module-pgsql-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-pgsql-mcrypt-freetype-gd.so
    mod_php3-3.0.16-module-pgsql-mcrypt-ftp-imap-freetype-gd.so
    mod_php3-3.0.16-module-pgsql-mcrypt-ftp-imap.so
    
    BSD/OS PHP 3.0.12
    No database support
    mod_php3-3.0.12-module.so
    mod_php3-3.0.12-module-imap.so
    mod_php3-3.0.12-module-gd.so
    mod_php3-3.0.12-module-imap-gd.so
    
    mSQL database support
    mod_php3-3.0.12-module-msql-gd.so
    mod_php3-3.0.12-module-msql-imap-gd.so
    mod_php3-3.0.12-module-msql-imap.so
    mod_php3-3.0.12-module-msql.so
    
    MySQL database support
    mod_php3-3.0.12-module-mysql.so
    mod_php3-3.0.12-module-mysql-imap.so
    mod_php3-3.0.12-module-mysql-gd.so
    mod_php3-3.0.12-module-mysql-imap-gd.so
    
    PostgreSQL database support
    mod_php3-3.0.12-module-pgsql.so
    mod_php3-3.0.12-module-pgsql-imap.so
    mod_php3-3.0.12-module-pgsql-gd.so
    mod_php3-3.0.12-module-pgsql-imap-gd.so
    
  4. Add the following line to the top of your Virtual Server web server configuration file (~/www/conf/httpd.conf) to dynamically load the PHP3 dynamic module. Substitute the name of the dynamic module you want to install for MODULE-NAME.
    LoadModule  php3_module  modules/MODULE-NAME
    
  5. 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 Virtual Server Web Server.
    1.  
    2. Modify the DirectoryIndex line so that index.php3 files will be included as directory indices.
      DirectoryIndex index.php3 index.cgi index.html index.htm
      
    3. Add the following lines so that all files with .php3 and .phtml extensions will be redirected to the PHP3 dynamic module.
      AddType application/x-httpd-php3 .php3
      AddType application/x-httpd-php3 .phtml
      



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

  1.  
  2. Install the PHP3 software. Use the commands below, depending upon your Virtual Server O/S to install the basic build of PHP3.
    FreeBSD PHP 3.0.16
    % vinstall php
    
    BSD/OS PHP 3.0.12
    % cd
    % tar xvf /usr/local/contrib/php-3.0.12-redirect.tar
    

    We have made a number of PHP3 CGI builds available. To install a build with features that you want, use one of the following commands, instead of those above.

    FreeBSD PHP 3.0.16
    % vinstall php
    % vinstall php-msql
    % vinstall php-mysql
    % vinstall php-pgsql
    
    BSD/OS PHP 3.0.12
    No database support
    % tar xvf /usr/local/contrib/php-3.0.12-redirect.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-imap.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-gd.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-imap-gd.tar
    
    mSQL database support
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-msql.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-msql-imap.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-msql-gd.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-msql-imap-gd.tar
    
    MySQL database support
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-mysql.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-mysql-imap.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-mysql-gd.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-mysql-imap-gd.tar
    
    PostgreSQL database support
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-pgsql.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-pgsql-imap.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-pgsql-gd.tar
    % tar xvf /usr/local/contrib/php-3.0.12-redirect-pgsql-imap-gd.tar
    
  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 Virtual Server Web Server.
    1.  
    2. Modify the DirectoryIndex line so that index.php3 files will be included as directory indices.
      DirectoryIndex index.php3 index.cgi index.html index.htm
      
    3. Add the following lines so that all files with .php3 and .phtml extensions will be redirected to the PHP3 CGI executable.
      AddType application/x-httpd-php3 .php3
      AddType application/x-httpd-php3 .phtml
      Action  application/x-httpd-php3 /cgi-bin/php