I use the Google cloud launcher to start a fresh Wordpress.
with the following VM :
Machine type
f1-micro (1 vCPU, 0.6 GB memory)
CPU platform
Intel Ivy Bridge
Zone
us-central1-f
It was launched with an older version : 4.5.3-1
I tried to do an automatic update. it didn't work, and showed
The update could not be unpacked
Installation Failed
I tried following tutorials on
https://community.bitnami.com/t/automatic-update-wordpress-4-6-is-not-working/43814/4
Connect to your server via SSH and execute:
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content
Doesn't work for my case,
I also tried to use follow manual update https://codex.wordpress.org/Upgrading_WordPress.
Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
using filezilla ftp , i get a lot permission denied errors of different file names.
Error: rm /opt/bitnami/apps/wordpress/htdocs/wp-includes/customize/class-wp-customize-partial.php: permission denied
Please advice. how can i update this thing?
Anyone facing the same issue?
Google should put back their own wordpress.
You can try the following workaround to upgrade your old WordPress to the latest version:
Open /opt/bitnami/apps/wordpress/htdocs/wp-config.php
Look for define('FS_METHOD', 'ftptext');
Replace it with define('FS_METHOD', 'direct');
Change the permissions of /opt/bitnami/apps/wordpress/htdocs to allow the server user (daemon) to make the modifications. You can do that by executing sudo chown -R daemon /opt/bitnami/apps/wordpress/htdocs
Go to the WordPress admin panel and perform the automatic upgrade.
Change the permissions of /opt/bitnami/apps/wordpress/htdocs to it original ones. To do that, execute sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs
Replace again the define('FS_METHOD', 'direct'); line with define('FS_METHOD', 'ftptext'); in the wp-config.php file
Hope it helps.
Related
I have an AWS EC2 (Ubuntu Server 18.04 LTS (HVM), SSD Volume Type) on Apache with a working WordPress site on it.
If I run sudo chown -R ubuntu:ubuntu /var/www/html, then I can edit files via SFTP and save them, but not update my plugins.
If I run sudo chown -R www-data:www-data /var/www/html, then I can update my plugins but not edit files via SFTP and save them.
How can I update my plugins and edit my files without having to run the corresponding command each time?
I have already run sudo chmod -R 755 /var/www/html.
The permissions seems correct to me. Did you install a ftp server in the ec2 instance?
As you don't mention that, I guess you will have to install one than use credentials in wordpress to connect. Here's one guide to install and configure ftp at ubuntu
http://gabrielmagana.com/2014/11/installing-ftp-server-vsftpd-on-an-amazon-ec2-ubuntu-14-04-host/
If I remember correctly, you can set the owner of the directory to www-data. Then add user Ubuntu to the www-data group.
sudo adduser www-data ubuntu
What I did
Last night while updating plugins on my Wordpress site my site crashed and I had to spin up a new server and restore from a Vaultpress backup. Once the restore had finished propogating I was unable to update the plugins so I ran the command
chown -R www-data:www-data /var/www/html/
I got the response
-bash: cd: /var/www/html: No such file or director
So after a bit of snooping I determined my directory path was off slightly. So, I ran
chown -R www-data:www-data /var/www/html/html.old
What happened
After running the chown command when I attempt to install plugin updates I get this in-browser error message:
Not Found
The requested URL /wp-admin/plugins.php was not found on this server.
Apache/2.4.29 (Ubuntu) Server at $domain Port 80
My question
Obviously I broke something when I ran the chown command, so how do I undo the command that I ran?
Any help would be very much appreciated
I don't think it's possible to revert the chown command unless you have a backup or know which file belongs to whom or all files belonged to a single user, which I doubt is the case here.
To be clear on some things, I have tried:
going into config.php and inputting define FS_Method, FTP_Base, FTP_Content_Dir, FTP_Plugin_Dir, FTP_User, FTP_Pass, FTP_Host, FTP_SSL
setting file permissions to 755 on wp-content, wp-content/uploads, wp-content/plugins
Things I do not have access to: cpanel, file manager, ubuntu, commands, SSH credentials.
I have spoken to my web host (it is a shared host account), and they will not provide me info on SSH. The only backend I have access to is wordpress admin and FTP through FileZilla or WinSCP. The web host has declared this issue to be in my court and refuses to help me out (unless I want to be charged a hefty fee).
Now, the issue is updating plugins. I can activate and deactivate plugins. But I can't install, delete or update plugins. Originally, the issue was "can't create directory" but then I changed define(FS_METHOD) to ftpsockets. Originally it was direct. (ftpext did not work whatsoever).
NOW the issue is "Update Failed: Could not copy file. all-in-one-wp-migration/all-in-one-wp-migration.php" for the plugin All-in-one WP Migration.
Can anyone help me out or point out what I'm doing wrong?
check your disk quota , the space assigned to your account , it looks like you may be overquota and hence the updates are failed.
As other posts indicate, the root cause is a permissions problem in /var/www/html/wordpress. In my case, I used Microsoft document https://learn.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-lamp-stack to install LAMP in Azure on Ubuntu 18.x LTS. I set the app to use the SFTP plugin for updates & uploads per https://wordpress.org/plugins/ssh-sftp-updater-support/. Then I changed permissions in as needed to the directories 'plugins themes upgrade uploads', group www-data (I used top to determine this, but other tools will do the trick), 775 on directories and 664 on files. Of course the user ID used to SFTP files had to be added to the www-data group on the system. I DID NOT set permissions to 777 as some have suggested in other posts and blogs.
Your situation may vary for required group ownership permissions. So analyze accordingly.
And best of luck.
Get your webhost to do this or you can do it yourself if you have SSH access
sudo usermod -aG www-data $USER
sudo chown -R www-data:www-data /var/www
sudo chmod -R 774 /var/www
you may want to revert back to the default: prevent writeable
sudo chmod -R 755 /var/www
I installed Wordpress to google cloud but when i want to install a plugin, it is asking for ftp credentials.
I added "define('FS_METHOD', 'direct');" to wp-config.php file.
I have to give right permission to folders.
What is the giving permission code line for gcloud ssh?
i solve the "insue" doing this
nano /var/www/html/wp-config.php
add the following line
define('FS_METHOD','direct');
then
sudo chown -R www-data.www-data /var/www/html
sudo chmod 755 /var/www/html
works for my on click to deploy intallation
I'm hosting a wordpress site on ec2 and I'm trying to update my theme through the admin screen. Its asking me for Hostname and ftp username and password. Is ec2-xxx.compute-1.amazonaws.com:22 my hostname? I tried along with ec2user and root for my ftp username but no luck. What am I doing wrong?
Skip the FTP info altogether and just change the permission of the directory structure where Wordpress is installed.
VIA SSH
sudo chown -R apache:apache path/to/wordpress
sudo makes sure you execute as the root user
chown will change the owner of the directory
-R will make it recursive, so it changes all files and directories within
apache:apache is user:group
And then the path to wordpress. Could be /var/www/html/sitename.com or if you navigate to the folder where Wordpress is installed, you can use a period (.) to tell it to change the current directory.
This will make is so that you can't copy files via sftp though, so it is good to change at least the themes directory back to the ec2-user:ec2-user user and group.
So this changes back to your ssh/sftp user:
sudo chown -R ec2-user:ec2-user path/to/wordpress
You can assign the folders to the ftp user and the apache group and then make them group writable as well. This will allow you to ftp into the directory, and allow everything to be auto updated within Wordpress.
// Set the wp-contents into the apache group and then make files group writable
sudo chgrp -R apache wp-content
sudo chmod -R g+w wp-content
// This makes new files created in wp-content and all of its sub-directories group-writable.
sudo chmod g+s wp-content
Then add this to wp-config.php to force Wordpress to update when only applying this wp-content:
define('FS_METHOD', 'direct');
You can also apply to the whole Wordpress install to auto update Wordpress and not just plugins/themes. If you do this, I would recommend putting your wp-config.php file one directory above your Wordpress install though, so you can lock it down separately.
EDIT: Whenever I am having permission troubles on EC2, I go to site root directory, and paste these lines in. I apply it to the whole Wordpress install these days:
sudo find . -type d -exec chmod 0755 {} \;
sudo find . -type f -exec chmod 0644 {} \;
sudo chown -R ec2-user:apache .
sudo chmod -R g+w .
sudo chmod g+s .
I use something similar on my Mac as well.
In your wp-config.php under directives add this line:
define('FS_METHOD', 'direct');
You can simply solve this problem by doing this via ssh:
sudo chown -R apache path/to/wordpress
then
sudo chmod -R 755 path/to/wordpress
Your hostname would be ec2-107-20-192-98.compute-1.amazonaws.com.
Your username will be the username you use to SFTP to the instance normally - ec2user for some instance types, ubuntu for Ubuntu AMIs, etc. EC2 generally doesn't use passwords, preferring SSH keys, so you'll have to set a password for your account by doing passwd on the commandline.
Try adding FTP credentials to wp-config.php: http://codex.wordpress.org/Editing_wp-config.php and http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
That should make WP admin stop asking for FTP details. But depending on how you've set up permissions via the command line, may have to go to the command line to edit files like wp-config.php . And you may not have sufficient permissions to upload and for WP to unzip a theme.
As per other answers, I use SFTP with a server of ec2-xx-xxx-xx-xx.compute-1.amazonaws.com username of ec2-user
ec2-107-20-192-98.compute-1.amazonaws.com:22 represents both the hostname and the ssh port. (SSH is normally on port 22, though it can run on any port.)
Try just ec2-107-20-192-98.compute-1.amazonaws.com in the hostname field.
I'm still skeptical of a webpage asking for a username and password. Seems a bit silly to me, since you should just use SFTP to directly upload whatever content you want using your SSH identity key instead of a password.
You could simply use 127.0.0.1 as hostname and check FTP in Wordpress ftp settings.
To resume what has been said:
user is the same you actually use to SSH/SFTP
password needs to be set/updated logging in via SSH and typing
sudo passwd your-user-name