Question
How to update WordPress?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×sudo chown -R www-data:www-data /path/to/WordPress_directory
sudo chown -R www-data:www-data /var/www
If anyone else is on Ubuntu 16.04 use sudo chown -R www-data:www-data /var/www
. Updates work for me now
You might want to change that to
sudo chown -R www-data:<username> /var/www/html
at the end to tighten up permissions.
From here - https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04
Step 5
It says to use sammy:www-data where sammy is his sudo name.
But I think my sudo name is root as when in sudo mode I show root@myname in the terminal.
If I try this
sudo chown -R root:www-data /var/www/html
The site breaks..so that’s not right either.sudo chown -R www-data:www-data /var/www
is the only thing that works but for multisite server I am concerned it isn’t so secure.
You are/This is correct. From the manual:
Usage: chown [OPTION]… [OWNER][:[GROUP]] FILE…
It should indeed be user:www-data.
Yes thanks. I am not sure why root:www-data didn’t work but that is insecure anyway.
If you have multiple sites and the server owns permissions then isn’t this bad. I thought we should have each website own the rights to modify only its own files and folders…I thought this is why we created a wordpress group..for example if a hacker gets a script in one website then the script is able to act across the other sites? This may be entirely wrong but I am not seeing a clear answer online for this. So thank you for insight or answers.
Hi all,
You can also update the WordPress core using WP-CLI from your command line. WP-CLI is useful for managing your website and one of the options you can use is to update the WordPress version for your site.
We have an existing tutorial on how to use WP-CLI to manage your WordPress site which you can check here:
Run the following command to check if there is an available update for WordPress.
wp core check-update
If there is an available update you will get the information about the update like version, updatetype and packageurl or else, the output will indicate that no update is available.
Run the following command to update WordPress:
wp core update
You will get the following output if the update completed successfully:
Success: WordPress updated successfully.
Hope that this helps!
Regards,
Alex
I am not sure of the root I took to get wordpress but I can say that I have two combinations for group and user
I seem to remember setting these and you say they should belong to ubuntu which is
www-data www-data
instead of wordpress as itself
501 staff
I am probably getting mixed up somewhere so would appreciate learning how so and to manually do what is needed. Thanks for insight.