I have been having problems with WordPress Updates for a while. No error messages, just the WordPress Update, or WordPress Plugin Update, hangs.

Then I found out that the WordPress backup plugin I am using, BackWPUp, failed if I configured it to use any compression.

Then I found out that the problems I had been having with random-seeming 500 Server Errors was from the WP-Super-Cache plugin configured with, hmm, compression.

WordPress Updates would create new folders, but no files in them.

I wrote a PHP program, outside of WordPress, to test if the problem was in WordPress, or in the version of PHP used on my server.

The problem is in PHP. The PHP unzip routines lock up. No error message on screen, in the PHP log, or in the system log.

WordPress 3.6.0 and 3.6.1, Multi-Site, Apache, PHP Version 5.2.17, [HTTP_ACCEPT_ENCODING] => gzip, deflate

PHP itself has a bug in Zip/Unzip in old versions. Hangs without any error message displayed or in logs. Affects WordPress Update, and Plugin/Theme Updates, and any plugins that use compression (e.g. WP-Super-Cache or BackWPup)

PHP Change Log http://www.php.net/ChangeLog-5.php#5.3.4 says
PHP Version 5.3.4 released 09-Dec-2010 – Fixed crash in zip extract method

Note: PHP versions are numbered so version 5.3.10 is higher than 5.3.9 (5.3.1 is lower)

These PHP Unzip methods hang:
$zip->extractTo($path.'/folder') or copy("zip://".$zipFullPath.'#'.$filename, $destPath.$destName)

I have not found a direct PHP method of testing it, beyond observing the program hangs. Neither command returns a result, they just hang.

The .zip file is being opened, I can read the number of files in it, and read the file names. The .zip routines report the file is valid (as does 7-Zip on Windows), and the file is downloaded directly from WordPress.org, and other files hang the same way.

I recommend WordPress adding a test for PHP unzip routines working, and if not, use a WordPress substitute (the PHP unzip code from a newer version of PHP?).

Many of the “WordPress Update Hangs” problems reported for years, might disappear with this change.

Looks like this PHP bug might have been fixed in PHP Version 5.3.4 09-Dec-2010 – “Fixed crash in zip extract method” www.php.net/ChangeLog-5.php#5.3.4

My hosting account (LunarPages) already had PHP 5.3.24 (released 11-April-2013) installed, changing one line in my .htaccess file switched me to the newer version:
AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

Pin It on Pinterest

Share This