Title: Upgrading Via SSH2 &#8211; Installation Failed
Last modified: August 20, 2016

---

# Upgrading Via SSH2 – Installation Failed

 *  [war59312](https://wordpress.org/support/users/war59312/)
 * (@war59312)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/upgrading-via-ssh2-installation-failed/)
 * Hi,
 * I am trying to get upgrading wordpress via SSH2 working correctly.
 * Updating plugins is working perfectly.
 * But when it comes to updating wordpress itself fails with:
 * > Downloading update from [http://wordpress.org/wordpress-3.1.3.zip…](http://wordpress.org/wordpress-3.1.3.zip…)
   > Unpacking the update…
   > Verifying the unpacked files…
   > Installing the latest version…
   > Could not copy file.: /usr/local/nginx/html/wp-content/themes/index.php
   > Installation Failed
 * Notice I am using the nginx web server which is running on Ubuntu Server 10.10.
 * These errors are logged in localhost.error.log:
 * > 2011/06/03 19:36:54 [error] 18269#0: *18 FastCGI sent in stderr: “PHP Warning:
   > file_put_contents(): Unable to open ssh2.sftp://Resource id #146/usr/local/
   > nginx/html/.maintenance on remote host in /usr/local/nginx/html/wp-admin/includes/
   > class-wp-filesystem-ssh2.php on line 165
   > PHP Warning: file_put_contents(ssh2.sftp://Resource id #146/usr/local/nginx/
   > html/.maintenance): failed to open stream: operation failed in /usr/local/nginx/
   > html/wp-admin/includes/class-wp-filesystem-ssh2.php on line 165
   > PHP Warning: file_put_contents(): Unable to open ssh2.sftp://Resource id #146/
   > usr/local/nginx/html/wp-content/themes/index.php on remote host in /usr/local/
   > nginx/html/wp-admin/includes/class-wp-filesystem-ssh2.php on line 165
   > PHP Warning: file_put_contents(ssh2.sftp://Resource id #146/usr/local/nginx/
   > html/wp-content/themes/index.php): failed to open stream: operation failed 
   > in /usr/local/nginx/html/wp-admin/includes/class-wp-filesystem-ssh2.php on 
   > line 165
   > PHP Warning: file_put_contents(): Unable to open ssh2.sftp://Resource id #146/
   > usr/local/nginx/html/wp-content/themes/index.php on remote host in /usr/local/
   > nginx/html/wp-admin/includes/class-wp-filesystem-ssh2.php on line 165
   > PHP Warning: file_put_contents(ssh2.sftp://Resource id #146/usr/local/nginx/
   > html/wp-content/themes/index.php): failed to open stream: operation failed 
   > in /usr/local/nginx/html/wp-admin/includes/class-wp-filesystem-ssh2.php on 
   > line 165″ while reading upstream, client: 127.0.0.1, server: localhost, request:“
   > POST /wp-admin/update-core.php?action=do-core-upgrade HTTP/1.0”, upstream: “
   > fastcgi://127.0.0.1:9000”, host: “127.0.0.1”, referrer: “[http://127.0.0.1/wp-admin/update-core.php&#8221](http://127.0.0.1/wp-admin/update-core.php&#8221);
 * Again updating plugins via SSH2 is working. So SSH2 itself is working correctly
   it seems.
 * The version of wordpress I am trying to upgrade from is wordpress 3.1
 * So ideas on how to fix this issue?
 * Thanks for the help,
 * Will
 * Update: And of course after trying to figure this out for an hour. And a few 
   minutes after posting I fix it.. Figures! 😉
 * Anyways, I had to run these two commands to fix it:
 * >  sudo chmod -R 755 /usr/local/nginx/html/wp-content
   > sudo chown -R www-data /usr/local/nginx/html
 * At first, I had only run the first one then, but then upgrading failed once again
   saying it could not access the upgrade folder.
 * After running the second command everything worked as expected and it successfully
   upgraded. 🙂

The topic ‘Upgrading Via SSH2 – Installation Failed’ is closed to new replies.

## Tags

 * [Failed](https://wordpress.org/support/topic-tag/failed/)
 * [upgrading](https://wordpress.org/support/topic-tag/upgrading/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 0 replies
 * 1 participant
 * Last reply from: [war59312](https://wordpress.org/support/users/war59312/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/upgrading-via-ssh2-installation-failed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
