Automatic updates in WordPress


With the release of WordPress 2.7 on 11th December, I was facing a problem: Manual plugin updates don’t seem to be provided for anymore. To date, I had always downloaded my plugins using the download link in the backend and then moved them to my server via FTP, because the automatic update had never worked for me – instead I always got the well-known error message “open basedir restriction in effect”. I always thought that was down to the configuration of my server and therefore outside my sphere of influence, and so I just put up with it.

Now however, WordPress notifies you in the backend when new plugin updates are available, but there is no longer a direct download link to the .zip file. That would have meant that I had to search for every plugin on wordpress.org myself or visit the author’s website every time to download the current version as .zip file there. Extremely annoying! This gave me cause to go searching for a solution once more, and lo and behold, I found one on LastManStanding.de.

Open your wp-config.php, and below (!) the line

define('ABSPATH', dirname(__FILE__).'/');

add the following:

putenv("TMPDIR=" . ABSPATH . "wp-content/upgrade");
define('WP_TEMP_DIR', ABSPATH . "wp-content/upgrade");

It doesn’t matter what you name the subfolder of wp-content. I preferred the name “upgrade”, because in my case, WordPress itself had already created it with that name a while ago. But you could also name it “tmp”, as suggested on LastManStanding.de, or yet different. Note: The directory must of course exist, i. e. you have to create it if necessary, and WordPress must have writing permissions in that folder!

Now everything works as intended: Plugins as well as WordPress itself can now be updated with one simple mouse click! Incredibly comfortable!


18 responses to “Automatic updates in WordPress”

  1. Hi,

    ich bekomme immer folgende Fehlermeldung, wenn ich die Änderungen durchgeführt habe.

    Parse error: syntax error, unexpected ‘=’ in /is/htdocs/xxxxx/www/wordpress/wp-config.php on line 10

    Weiss jemand woran das liegt?

    Beste Grüße und danke für obige Anleitung,
    Marco

  2. Na, dann sag uns mal genau, was Du in die wp-config.php geschrieben hast.
    Ich denke, da muß irgendwo ein Tippfehler drin sein, irgendwelche Anführungszeichen nicht richtig geschlossen oder ein Semikolon zu wenig.

  3. Der Abspath ist ja schon definiert. Deshalb kann man sich die erste Zeile vereinfachen. Das macht es Nicht-PHP-Experten vielleicht etwas einfacher:

    putenv(“TMPDIR=”.ABSPATH.”wp-content/upgrade”);

    Gruß
    Markus

  4. Vielen Dank für die super Tipps, jetzt startet das Upgrade zwar auch bei mir, aber es bleibt immer bei “Update wird entpackt.” hängen…
    Irgendeine Idee woran das liegen könnte?

  5. Daß ich das hier geschrieben hatte, ist ja schon ein Weilchen her – inzwischen sind wir ja schon bei WordPress 2.8. Es kann also gut sein, daß nicht mehr alles davon sinnvoll ist. ;)
    Bei mir war es beispielsweise so, daß ich mit 2.8 die Zeilen

    putenv("TMPDIR=" . ABSPATH . "wp-content/upgrade");
    define('WP_TEMP_DIR', ABSPATH . "wp-content/upgrade");

    wieder komplett löschen mußte, sonst hing es auch bei mir beim Entpacken der .zip-Datei fest.

    Welche Version von WordPress benutzt Du? Wenn Du noch irgendeine 2.7.x haben solltest, kannst Du auch mal versuchen, Deine http.php durch die folgende zu ersetzen:
    http://core.trac.wordpress.org/export/11450/trunk/wp-includes/http.php
    (Auf jeden Fall ein Backup vom Original machen und am besten direkt wiederherstellen, falls es eh nichts gebracht hat.)

    Quelle: http://wordpress.org/support/topic/278487?replies=36

Leave a Reply

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