|
PHP4 CGI
The PHP CGI is a free-standing PHP interpreter. While this makes
PHP available through the command line, it is less efficient than the PHP Apache Module.
| NOTE: Any version of PHP prior to 4.2.2 has a known security vulnerability
which can compromise your virtual server. If you are using any version prior to PHP4.2.2, we
strongly encourage you to upgrade to the current version. |
PHP4
To install PHP4 CGI on your virtual server, connect to your server via SSH or Telnet and do
the following:
-
Install the PHP4 CGI by running the following command:
% vinstall php4-cgi
When you run the vinstall command, you will be given the option to select which
extensions you want to use. In order to not waste memory on your virtual server, we recommend
that you only select extensions you will actually be using. If you find you need to add or
remove extensions at a later time, you can manually edit the php.ini file, or use the
vinstall command to change the active extensions.
-
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.cgi php
-
Make the following additions and modifications to your web server configuration file
(~/www/conf/httpd.conf).
-
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
-
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
-
Restart your Web Server by running the restart_apache command.
-
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.
|