Using WordPress in a subdomain?

This is pretty niche stuff, but I’m posting it just in case someone else happens to find it useful…

If your WordPress blog lives in a subdomain (this one is at blog.sfocata.co.uk, not www.sfocata.co.uk) you may well have problems upgrading plugins and WordPress itself. In my case, the “upgrade automatically” buttons give this error…

Upgrade Plugin

Downloading update from http://downloads.wordpress.org/plugin/blahblah.zip

Download failed.: Could not create Temporary file

Plugin upgrade Failed

Of course, I can still download manually, unzip and install via FTP, but it’s annoyingly fiddly when a more streamlined alternative supposedly exists.

The support forums give a range of potential solutions, of which the first one I tried worked perfectly! Bear in mind this didn’t work for at least one other person, and it may be specific to Unix servers, I have no idea.

When you click an “upgrade automatically” button, you’re prompted for standard FTP details. DON’T put any subdomain information in the “host” box… just put the top-level address (in this case, ftp.sfocata.co.uk) and WP will find the right directory. The issue here is with WP not being able to create a temporary file, so we’ll give it some help.

Open your FTP program, navigate to the directory where “wp_config.php” lives (probably in subdomain/httpdocs) and create a new folder. Call it “tmp” and CHMOD it to 777. If you don’t know how to (or can’t) send raw server commands, your FTP program may have a more graphical way of doing it. I’m using Transmit, and it’s simply a matter of selecting a file or folder and choosing “Get Info” (or cmd-i).

Next, open the file “wp_config.php” and add this line…

define(‘WP_TEMP_DIR’, ABSPATH . ‘tmp’);

Save it to the server, and with any luck, your automatic plugin upgrade should now work!

This entry was posted in Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>