PHP 7.0.3, 5.6.18, and 5.5.32 (plus a patch for PHP connection timeouts)

The PHP developers recently released versions 7.0.3, 5.6.18 and 5.5.32 that fix several bugs. We’ve upgraded the PHP 7.0, 5.6 and 5.5 series on our servers as a result.

These changes should not be noticeable, but in the unlikely event you experience any trouble, don’t hesitate to contact us.

In addition, we’ve added a “patch” to PHP on our systems that will help avoid an issue that can cause WordPress sites to stop working when using poorly-written plugins or themes.

The problem happens when plugins or themes contact an external third-party server, but that server doesn’t respond. This makes WordPress “hang” for up to five minutes with no indication of what’s wrong(!). And it’s hard to troubleshoot, because the external server might start working again a few minutes later, and the problem disappears.

To avoid this, our version of PHP now sets a default connection timeout of 20 seconds, rather than PHP’s default of 300 seconds (assuming the script doesn’t set its own timeout, of course). It also logs slow failed outgoing connections in the error log like this:

PHP Warning: curl_exec(): Failed outgoing connection to 'http://example.com/api' took 20 seconds in /wp-content/plugins/name/file.php on line 4

This will make WordPress sites hosted on our servers more reliable, even if they use plugins or themes that would “hang” other servers. It will also make it much easier to track down the exact cause of this problem in the future.