





 
 
 
 
 
 
 
 
 
|
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.
Which install is right for me?
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. 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 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.
mod_php3-3.0.16-module-msql-mcrypt-ftp-imap.so
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.
mod_php3-3.0.16-module-pgsql.so
By selecting the PHP build carefully, you will maximize your virtual server's
memory use as well as improve the performance of your Apache
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
We've provided more information here.
Installation PHP 4 with CGI Redirect
The other way to install PHP4, as a CGI to which PHP3 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
NOTE:
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-msql
% 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
directory.
% 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,
.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
|
 |