are two different ways to install PHP4 on
a Virtual Server. The best way is to install it as a Dynamic
Which version of PHP4 should I install?
Within each version of PHP, there are several "builds" to choose from. A
build consists of PHP'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.
Bottom Line: You should choose the build that best suits your needs
but at the same time does not add unnecessary overhead to your web server.
Example 1: If you plan on making use of PHP to transfer files between
computers, or to use TWIG to access
your email, you'll want to choose a PHP build that includes ftp, imap, and
the database backend you're using for TWIG in the build name.
Example 2: If you want to use PHP chiefly to access a PostgreSQL
database, but not build images on the fly, choose a PHP build with pgsql
but without freetype and gd in the build name.
By selecting the PHP build carefully, you will maximize your virtual server's
memory use as well as improve the performance of your Apache
PHP4 no longer creates GIF images via lib-gd. Due to patent restrictions
on the GIF compression algorithm we can no longer support it. The
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.
Dynamic Module Installation
We've provided more information here.
Installing PHP 4 as a CGI Redirect
The other way to install PHP4, as a CGI to which PHP files are redirected
by the web server, is shown below. Connect to your Virtual Server via Telnet
or SSH and do the following:
- Change to your home directory:
- Install the PHP4 software using the command below:
% vinstall php4
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.
% vinstall php4-mysql
% vinstall php4-pgsql
(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. )
- 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
% cd ~/www/cgi-bin
% ln ../../../bin/php php
- Make the following additions and modifications to your Virtual Server
web server configuration file (~/www/conf/httpd.conf).
- Modify the DirectoryIndex
line so that PHP 4 files will be included as directory indices.
DirectoryIndex index.php index.php4 index.php3 index.cgi index.html index.htm
- Add the following lines so that all files with .php,
and .phtml extensions
will be redirected to the PHP4 CGI executable.
AddHandler php4-script .php .php3 .php4 .phtml