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”
bei mir macht er jetzt zwar, dass er das Update lädt, entpackt etc.
Dann kommt aber folgende Meldung:
Update wird entpackt
Entferne die alte Version des Plugins
Altes Plugin konnte nicht entfernt werden
Pluginaktualisierung fehlgeschlagen
Jemand eine Idee, woran es liegen könnte?
Jo, Du mußt auf jeden Fall dem gesamten plugins-Ordner sowie seinen Inhalten Schreibrechte geben, sonst kann WordPress eben die alten Dateien nicht löschen und die neuen auch nicht reinschieben.
der Pluginsordner hat bereits 777, aber geht trotzdem nicht :(
Hmm, die Unterordner und Dateien darin denn auch alle?
Bei meinem FireFTP setze ich die Rechte mittels Rechtsklick → „Properties (incl. contents)” und habe dann dort die Optionen “This Folder”, “All Contained Folders” und “All Contained Files”. Diese hake ich alle an, und dann setzt er die Rechte für alle enthaltenen Ordner und Dateien.
jetzt gehts. super DANKE
Merry X-MAS
Soweit so gut, aber bei mir kommt jetzt die Fehlermeldung:
Neue WordPress-Version wird entpackt.
Warning: copy(/mein Pfad/www/wp-admin/includes/update-core.php) [function.copy]: failed to open stream: Permission denied in /mein Pfad/www/wp-admin/includes/class-wp-filesystem-direct.php on line 122
Jemand ´ne Idee ???
Dateien konnten nicht kopiert werden
Naja, auch da wieder die Frage: Hat WordPress Schreibrechte in dem Ordner, den Du in der wp-config.php angegeben hast (also z.B. wp-content/upgrade)?
Der Ordner sollte die Rechte 775, oder testweise vielleicht auch 777 haben, sonst kann WordPress ja die Dateien nicht da rein entpacken.
Eine andere Möglichkeit wäre, daß auf Deinem Server Safemode aktiviert ist. Sollte das der Fall sein, dann ist die Sache leider ziemlich hoffnungslos für Dich, soweit ich weiß. :)
Dann mußt Du weiter per FTP updaten.
Die Rechte sind alle korrekt. Das mit dem Safemode hatte ich auch schon befürchtet. Meine .htaccess läuft nämlich auch nicht… Im Webpack L von Hosteurope kann man den safemode nicht selbst einstellen.
Dann weiß ich auch nicht weiter, tut mir leid. Bei mir war der Safemode früher auch mal aktiv, und soweit ich das ergoogeln konnte, sind automatische WordPress-Updates damit unmöglich.
Aber schreib’ doch mal ein Ticket – unter dem zweiten Link steht ja, daß die Hosteurope-Menschen sehr bemüht sein sollen! Vielleicht können sie Dir auch irgendwie helfen. ;)
Hi,
ähm, ich hab das WebpackL von Hosteurope und bei mir ist der Safemode off bzw habe ich nicht die geringsten Probleme damit. Hast Du mal den support angeschrieben? Ich meine aber im KIS kann man den safemode umstellen.
http://www.pixelfeuer.de/2008/12/20/pluginaktualisierung-in-wordpress-27-so-gehts
Guten Rutsch