WordPress 3.3 update fail: could not copy files

Posted on:

If you’re running WordPress on a Media Temple (dv) server and you’re using this wp-config fix from digwp.com and you’re getting an error when trying to update WordPress to 3.3+, I have a solution.

Let’s recap the scenario:

  1. You’re on a server such as a Media Temple (dv) that requires a variation of the following wp-config.php hack:

    define('FS_METHOD', 'ftpext');
    define('FTP_BASE', '/var/www/vhosts/jacobdubail.com/httpdocs/');
    define('FTP_USER', 'username');
    define('FTP_PASS', 'password');
    define('FTP_HOST', 'host');
    define('FTP_SSL', false);

  2. When you try to automatically update WordPress from the admin, you get a variation of the following error:

    Downloading update from http://wordpress.org/wordpress-3.3-no-content.zip…
    Unpacking the core update
    Could not copy files
    Installation Failed

  3. You’ve searched google for an hour, screwed up your server security by chmoding a bunch of directories to 777, and you’ve deleted the upgrade folder half a dozen times.

To fix the upgrade issue, all you need to do is change the FTP_BASE definition from:

define('FTP_BASE', '/var/www/vhosts/jacobdubail.com/httpdocs/');

to:

define('FTP_BASE', '/httpdocs/');

It worked for me and I hope it works for you, too.

I’m assuming the problem is that the FTP_USER doesn’t have write access to the var directory so fails. But, if any of you knows the reason, I’d love to read it in the comments.

Installing SOAP on a GoDaddy Dedicated Virtual running CentOS

Posted on:

If you’ve run into problems installing SOAP via ssh, you’re not alone.

First, a little context:

A recent project required me to integrate a 3rd party API into the theme I was developing.  The API was SOAP-based, which, before this project, I had little to no exposure to.  Most API’s I encounter these days return JSON, not XML, which eliminates SOAP altogether.  So, I began by reading the PHP documentation for SOAP.  Pretty helpful stuff, but the thought that I’d have to install the extension on the server never crossed my mind.  When the most basic SOAP initialization call returned an error, I knew something was wrong.

$client = new SoapClient("soap.wsdl");

A quick Google search returned this post that briefly describes how to install SOAP for PHP on an Apache server.  The long and the short of it is this: yum install php-soap

Running this command on a GoDaddy Dedicated Virtual server running CentOS 5 returned an error:

php53-common conflicts with php-common
Error: php53-common conflicts with php-common
You could try using --skip-broken to work around the problem

By they way, make sure you’re connected to your server via ssh as root.  To do this on a GoDaddy server, you’ll need to run the su - command. You’ll be prompted for your root password, at that point.

So, because this server is running php 5.3, I needed to install a special php53 soap package. Here’s the command:

yum install php53-soap

I hope this saves someone a few minutes and a headache.