Last updated July 28, 2010. Created by Michael_Lessard... on July 28, 2010.
Log in to edit this page.

Depending on your Drupal version, php 4.4.0 up to php 5.2.x can be required (see requirements here).

Some of the oldest Drupal versions will only work with php 4 (ex.: Drupal 4.3.2), while numerous newer modules will rarely work on php 4 (you may get an error such as: Parse error: syntax error, unexpected T_VARIABLE ).

If your hosting service has both php 4 and php 5 available, which is almost always the case, you can easily choose which version should be used by your Drupal installations.

For example, you can have an older site running on php 4 and, on the same hosting account, have another running on php 5.

HOW TO :

In the .htaccess file of a given Drupal installation, simply add (preferably as the first item) :

AddHandler application/x-httpd-php5 .php
or...
AddHandler application/x-httpd-php4 .php

That's it.

Note that Cpanel usually gives you the option to select the default running PHP version, but this does not cause any problems. You can select PHP 4 as the default in the Cpanel, and nonetheless invoke PHP 5 in the .htaccess of a given Drupal installation.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.