CiviCRM 4.7.12-rc: Experimental support for PHP 7 / MySQL 5.7

2016-09-21 18:52
Written by

CiviCRM 4.7.x has made significant progress towards supporting PHP 7, MySQL 5.7, and Ubuntu 16.04. I'm pleased to announce the availability of the release-candidate for v4.7.12.

These improvements were made possible with the collaborative efforts of several people and organizations, including Mark Burdett (EFF), Mattias Michaux, Seamus Lee (Australian Greens), the New York State Senate, and the CiviCRM core team (Jitendra Purohit and me).


The release-candidate may be downloaded from the nightly build system:

Please note that release-candidates are intended for use on test/staging servers - they are not intended for installation on live/production servers. If you install an RC on a live/production server, you may have difficulty upgrading to the final release.

System Requirements

CiviCRM 4.7.12 retains the same general system requirements as previous releases: PHP 5.5 is recommended, and PHP 5.3 should work. PHP 7 is now experimentally supported.

As discussed during July, this improvement requires a subtle dependency change: the PHP extension mysqli must be enabled. The extension is generally available as a default or add-on for most PHP platforms (including PHP 5.0 through PHP 7.0). For detailed discussion, see the previous announcement, PSA: Please verify PHP extension "mysqli".

General Status

Several changes have been merged into 4.7.12-rc to improve support for newer hosting platforms, including:

  • Convert CiviCRM from php-mysql to php-mysqli
  • Update or patch a number of dependencies (esp. PEAR libraries)
  • Fix a number of new warnings

Compatibility with PHP 7.0 has been tentatively established by:

  • Installing CiviCRM on Joomla, Drupal, and WordPress in a PHP 7 testing environment
  • Executing the automated test suite (~5,000 tests) under Ubuntu 16.04 (PHP 7.0 / MySQL 5.7)
  • General click-around testing

The current release candidate has a few known issues and risks:

  • The dependency phpoffice is required for a recently created feature, mail-merge support for *.doc files. The version currently included with 4.7.12-rc is incompatible with PHP 7, but this may be upgraded. Fixing this may impact compatibility of the *.doc feature in PHP <5.3.23. (UPDATE: 4.7.12-rc now includes a newer version of phpoffice, as discussed at and So far, this does not appear to impact runtime compatibility, but for development builds based on git/composer, it increases requirements from PHP 5.3.10+ to PHP 5.3.23+.)
  • PHP 7 introduces a subtle change to the foreach construct. This usually has no impact on application behavior, but in some cases it might. We've prepared patches for the known instances, but other instances may still be discovered during testing.
  • The tests E2E_Extern_SoapTest::testGetContact, api_v3_ContactTest::testInternationalStrings, and CRM_Contact_Form_Task have problems which may be related to PHP 7. (UPDATE: On, the nightly matrix currently shows Ubuntu 12.04 and 16.04 producing the same test results for api_v3_AllTests, CRM_AllTests, and  Civi\AllTests.)

Note: Some pre-release/developmental editions required editing civicrm.settings.php to change CIVICRM_DSN -- however, this is not required in 4.7.12-rc.


Please deploy 4.7.12-rc on a test/staging system, check your most important customizations or workflows, and report feedback on success or failure. General comments should be posted on CRM-17789, and newly identified bugs may be reported as separate JIRA issues.

Feedback will be greatly appreciated from any environment, including PHP 5.x or 7.x. Although PHP 7 compatibility is a major theme, the release includes several other fixes, and changes in 4.7.12 (such as mysqli ) could affect any platform.

If there are any critical fixes which should be merged into 4.7.12-rc before release of y 4.7.12, please submit them as pull-requests to branch 4.7.12-rc.

Click thumbs up if you thought this blog post was useful (login to vote or to comment)


Awesome that we are keeping pace with the latest stable linux distributions and languages. Thanks to all the people you mentioned above :)

Today, I installed rc 4.7.12 successfully on Ubuntu 16.04.1 - Awesome Team! 

I installed RC 4.7.12 under Joomla, but when I ran the database upgrade, it flashed a message saying upgrading to 4.7.13.  This could be because I installed it over a pull from the latest civicrm/civicrm-core master repository.

Thanks for sharing. I think your intuition is probably right -- that some wires may have been crossed between the git code and the RC. I've found it tricky to work with Joomla + git-based Civi -- it seems like the civicrm-joomla installer is quite focused on zip-based installation, and manually mapping out the files from git can get overwhelming sometimes. (I eventually gave up -- I just use new/ephemeral sites when testing Joomla+Civi zip's. But if someone figures out some better workflows, it would be cool to learn about.)