PHP 4 Support

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

You really only need to do this if you need to test and support existing modules on php 4. Generally it is acceptable for new modules to release them php 5 only. Drupal 7 will be php 5 only. Unless you know for sure that you need this it is recommended to use the standard mod-php5 configuration instead.

Since Ubuntu 7.04 php4 packages have not been provided or supported by Ubuntu, so (unless you are running an older 6.xx version of Ubuntu) you will need to find/add repositories that provide php4 packages.
http://tumbleweed.org.za/2007/06/10/php4-for-feisty-pbuilder-for-beginners/ provides a repository for 7.04, and also instructions on building php4 from source which should work for 7.10.

To set this up you will need to install both the php5-cgi and php4-cgi packages, and uninstall the libapache2-mod-php5 package (if you have it installed already). You can do this using Synaptic (System -> Administration -> Synaptic Package Manager) or the following commands:

sudo apt-get remove libapache2-mod-php5
sudo apt-get install php5-cgi php4-cgi

You can then add the following code to /etc/apache2/httpd.conf

ScriptAlias /php5-cgi /usr/lib/cgi-bin/php5
ScriptAlias /php4-cgi /usr/lib/cgi-bin/php4
AddHandler application/x-httpd-php .php
Action application/x-httpd-php /php5-cgi

Your vhosts will then use php5 by default. If you have a vhost you want to use php4, you can easily do this by adding the following line to the top of your Drupal .htaccess file:

Action application/x-httpd-php /php4-cgi

Apache will then use php4 for serving this site (there is no need to restart Apache, this takes effect immediately).

Drubuntu

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: