by Elliot Christenson on February 12, 2016 - 8:36am

The short answer is: Drupal 6 officially supports only PHP 5.2, but you should use the highest version of PHP that doesn't break your site!

For the longer answer:

PHP 5.2.17 is the latest version of PHP in the 5.2.x branch of the popular programming language. While there are several newer versions, it's a safe bet that legacy code will operate under 5.2.17. However, there are potential security holes with earlier versions of PHP.

Drupal 6 core should safely work on PHP 5.3, 5.4 and 5.5 but you may have difficulties with modules that have not been kept active. This is especially true of legacy Drupal 6 custom modules. The right thing to do is to start with PHP 5.5 and work backwards until you hit a version that works with your needed modules. Rarely should ever need to go as far back to PHP 5.2.

In general, newer versions offer better security.

The 5.2.x branch was "end of lifed" on the 6th of January, 2011. That's more than 5 years ago at this writing. Even though efforts on PHP 5.3.x and PHP 5.4.x are also discontinued, development didn't halt until August 2014 and September 2015 respectively. There have been Drupal security vulnerabilities that only exist when running Drupal on older versions of PHP. With Drupal 6 nearing "EOL", there's no need to stack the deck against yourself if you are trying to attempt modernizing.

Also, we recommend using Pressflow - a fork of Drupal 6 core, that has improved performance and better support for newer PHP versions.

Some brief notes on your PHP configuration:

  • make sure mysql extension is enabled
  • in php.ini:
    • memory_limit =16MB - though a higher number like 64MB may give you better results
    • magic_quotes_gpc = off
    • register_globals = off
    • display_errors = Off

    At this writing, it is probably best to use MySQL version 5.1.72 as there can be potential issues or configuraiton challenges with the 5.5 or later versions running Drupal 6.

    (Don't want to worry about all that? Check out our Drupal 6 LTS options!)

    Want to read more articles like this?

    myDropWizard.com blog Subscribe to the myDropWizard.com blog and recieve e-mail updates when new articles are published!

    Add comment