Posted on

WordPress Upgrade Plugin Stops With No Error

When upgrading a series of WordPress plugins on a new development box, we would get through the FTP username prompts and then the process would just stop.  No errors, just a blank page.   After searching Google and various forums and uncovering a number of error messages people ran into when upgrading plugins on WordPress we had yet to come across the “no error error”.   Using our PHP debugging skills we decided to hunt down the error on our own.

It turns out the error was buried deep inside the wp-admin/includes/class-ftp.php on a call to the built-in dl php function  That function loads various system libraries.  In this case the sockets library.

Unfortunately WordPress squelches error output on various includes and dl statements.   Here they use this syntax:

 if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;

If the dl(…) call generates an error (which it was) you never see it.   Our problem was that the latest version of PHP that was manually compiled on our dev box was compile without socket support.   In order to get PHP 5.3.3 working well with WordPress you need a couple of things compiled in, including the MySQL libs and sockets enabled.

While WordPress will complain about MySQL not being compiled in, it does not check for sockets availability which disables the FTP uploads and thus any upgrades or installs of plugins or even the core WordPress product.

Here is the configuration script we used for building PHP5.3.3 on our CentOS 5.5 box to make it play well with WordPress 3.02.

./configure --with-apxs2 --with-zlib-dir=/usr/lib64 --with-libdir=lib64 --with-mysql --with-curl --enable-sockets