Ubuntu auf 16.04 aktualisiert, jetzt funktionieren Wordpress-Updates nicht

Ubuntu auf 16.04 aktualisiert, jetzt funktionieren Wordpress-Updates nicht

Mein Ubuntu 15.10-System funktionierte einwandfrei und Wordpress-Updates liefen über SSH. Aber als ich Ubuntu auf 16.04 aktualisierte, unterbrach der Wechsel zu php7.0 Wordpress-Updates. Zuerst wurde nach FTP-Anmeldeinformationen gefragt, bis ich php-ssh2 installierte (das darauf hinweist, dass es auf einem Git-Snapshot basiert). Wenn ich jetzt versuche, ein Plugin zu aktualisieren, heißt es

An error occurred while updating WP to Twitter: Unable to locate WordPress Content directory (wp-content).

Und in /var/log/apache2/error.log:

[Sun Jun 12 11:01:10.969931 2016] [:error] [pid 5545] [client 192.168.1.11:65278] PHP Warning:  file_put_contents(): Unable to open ssh2.sftp://Resource id #81/.maintenance on remote host in /home/blog/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php on line 252, referer: http://xxxx.com/wp-admin/update-core.php?action=do-plugin-upgrade
[Sun Jun 12 11:01:10.970772 2016] [:error] [pid 5545] [client 192.168.1.11:65278] PHP Warning:  file_put_contents(ssh2.sftp://Resource id #81/.maintenance): failed to open stream: operation failed in /home/blog/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php on line 252, referer: http://xxxx.com/wp-admin/update-core.php?action=do-plugin-upgrade

Fehlt mir ein Paket oder ein Konfigurationselement oder was?

Antwort1

Ich hatte das gleiche Problem. Dies scheint ein Fehler in php-ssh2 (aus dem Ubuntu-Repo) zu sein.

Nach dem Entfernen von php-ssh2 und der Installation einer neueren Version mit pecl (pecl install ssh2-1.0) war das Problem gelöst.

Ich habe einen Fehlerbericht eingereicht: https://bugs.launchpad.net/ubuntu/+source/php-ssh2/+bug/1617294

Antwort2

Die Installation der pecl-Erweiterung hat bei mir nicht funktioniert (wer weiß, warum), aber ich habe eine Alternative gefunden:

Ich habe dieses Plugin gerade per scp auf meinen VPS hochgeladen und es hat das Problem gelöst:https://wordpress.org/plugins/ssh-sftp-updater-support/

Antwort3

In meinem Fall hat jedoch keines der oben genannten Dinge geholfen.ein Patch von Ralphim PHP-Code hat das Update-via-ssh2-Problem für WordPress sowohl unter Ubuntu 14.04 als auch unter Ubuntu 16.04 für mich behoben:

--- a/wp-admin/includes/class-wp-filesystem-ssh2.php
+++ b/wp-admin/includes/class-wp-filesystem-ssh2.php
@@ -185,7 +185,7 @@
        if ( '/' === $path ) {
            $path = '/./';
        }
-       return 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $path, '/' );
+       return 'ssh2.sftp://' . intval($this->sftp_link) . '/' . ltrim( $path, '/' );
    }

    /**

Vergessen Sie nicht, diesen Patch nach der Aktualisierung erneut anzuwenden, bis eine endgültige Lösung in die WordPress-Version einfließt.

Antwort4

In meinem Fall hat nur die Installation der Bibliotheksversion 1.1.2 geholfen ...
pecl install ssh2-1.1.2

  • PHP 7.0.22-0ubuntu0.16.04.1
  • Apache/2.4.18

verwandte Informationen