18

With the feature freeze for PHP 5.5 long past, I figured it was time I post an update to the popular PHP 5.4 and Drupal 7 question.

So, can Drupal run on PHP 5.5?

21

In short, if your site runs on PHP 5.3, it will run on 5.5 as well, go upgrade! (Your dev environment, until a real release is out)

With the short answer out of the way, here are some more details.

With regard to "Does Drupal work on it", very little changed from PHP 5.3, to 5.4 to 5.5. The one issue that showed up under PHP 5.4 was really just PHP being better at telling developers when they were doing something wrong, rather than an incompatibility introduced by PHP. The details of that are well covered in PHP 5.4 and Drupal 7.

No similar new warnings show up with PHP 5.5 though, and while some things have changed, they are highly unlikely to have negative impact on your Drupal site.

One performance concern that was raised with running 5.4 was that APC was lagging behind in support. This will not be an issue this time, as 5.5 now includes a replacement for APC Optimizer+

Drupal 6: By now, most things work well with PHP 5.3, meaning it should work well on 5.5 as well. I have yet to test this myself.

Drupal 7: Runs smoothly, I've encountered no problems what so ever, largely because Drupal 7 was developed more with PHP 5.3 in mind, and any problems discovered on 5.4 have long since been fixed.

Drupal 8: Requires 5.3 from the start, so will work well. I will update the answer when I've tested it myself.

5
  • 1
    My personal site has been running on PHP 5.5 for some time without problems (though, granted, it's a pretty simple site). The most notable core-related problem that I'm aware of is that installation can fail if OPcache (the built-in opcode cache a la APC) is enabled, so if you want to use OPcache, you may need to disable it while installing, then re-enable it afterwards. Dec 26 '13 at 18:07
  • @GarrettAlbright I am researching updating our D6 site to PHP 5.5. Currently none of the date fields in the admin forms are showing the default date values. Have you seen any of issues like this?
    – Patrick
    Jan 6 '14 at 16:36
  • Patrick, I can't help you with anything regarding Drupal 6, except to advise you to upgrade if at all possible. That codebase grows ever more ancient. Jan 7 '14 at 0:12
  • @Letharion: Time to update the answer after testing D8 with PHP5.5?
    – Hugo
    Mar 11 '15 at 11:01
  • 1
    @Hugo Hmmm, definitely. I have forgotten this particular question, and while I've had a D8 site up I haven't kept this in mind. As a quick note, I've tried a few betas on my machine with 5.5, and it's all worked just fine. Thanks for the reminder though, I'll try to remember it next time I fiddle with D8.
    – Letharion
    Mar 11 '15 at 12:48
3

Updates to letharion's answer:

  • Drupal 8 now requires PHP 5.4.2 (probably even higher by the time we release it), and 5.5 is supported, although not required
  • Drupal 6 support for 5.3 is already good although issues still remain, handled as bugs because D8 migration from D6 will rely on PHP 5.3 being supported by D6.
1

Whilst installing a fresh version of Drupal 7.26 in a PHP 5.5 environment, I was getting the "Set-up database" screen load twice. On the 2nd submission of the form, I would then get a WSOD. Loading the site from the root path gave a 404.

I tracked down this patch (comment #45) which solved the problem for me. As you'll read there, it was due to the way the new PHP caching system works and the caching of the settings.php which stores the database credentials.

1

Adding the following lines to the main htaccess file can help.

php_value date.timezone America/New_York
php_value error_reporting E_ALL
php_value display_errors 1
php_value display_startup_errors 1
php_value memory_limit 256M
1
  • Adding php_value error_reporting E_ALL got me past the WSOD, the rest just helped debug. Dec 21 '15 at 19:00
0

I have hit a snag trying to install Drupal 7.26 on Ubuntu 13.10 (php 5.5).

Fatal error: Call to undefined function field_attach_load() in /var/www/d7/includes/entity.inc on line 316

I had to apply this patch - https://drupal.org/comment/7721819#comment-7721819.

Deleted existing database for this install.

Re-created the database and then ran install.php.

The problem for me was fixed with that patch.

1
0

Fresh install of drupal-7.26

Ran PHP 5.5.9 -got error: "...entity.inc on line 316"

In server-control-panel I changed my Drupal folder to use "PHP 5.4.25". Then hit back in browser, re-entered the install-data, and voila -> up and running...

Installed themes, some modules, created pages; changed back to PHP 5.5.9 -> still working...

0

Drupal 7: Check all issues with tag php 5.4 or php 5.5 to be sure you are not using any of the modules that still have issues with those versions: https://drupal.org/project/issues/search?text=&projects=&assigned=&submitted=&project_issue_followers=&&&&issue_tags_op=%3D&issue_tags=PHP%205.4%2C%20PHP%205.5.

If your site has any of those modules installed I think it is better to stick to php 5.3 for Drupal 7.

Drupal 6 Add the php 5.3 tag too as some less used or maintained modules still have issues with php 5.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.