Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 'Some files are not writable by WordPress' error, website cannot be changed by admin

I'm setting up a new website. most files are not editable by WordPress.

I am using a virtual machine on google cloud console. It's Ubuntu 18.04 LTS LAMP stack. I have tried editing permissions of the files through both Filezilla and the ssh prompt on gcloud. like it describes here. I think i have a different problem.

I am brand new and just learning so I'm sorry if the answer is obvious. I found that if I go in and manually set permissions for files to 775 in the SSH WordPress is able to edit some files. But i cannot edit permissions of some files even after i am in root sudo su

like image 906
Cambi8989 Avatar asked Aug 23 '19 16:08

Cambi8989


2 Answers

Apart from permissions you have to change the Owner of the Files to the web server user ( most cases, especially those using apache www-data ) .

The command to do that is the below

$ sudo chown -R www-data:www-data /path/to/wordpress/

the usual path of a website on a ubuntu server is /var/www/domain.com/ but of course that depends !

Wish you the best!

like image 163
Dimitrios Pantazis Avatar answered Oct 05 '22 06:10

Dimitrios Pantazis


change all files and folders permission as follow:

enter your public_html folder and execute this two commands

find . -type d -exec chmod 0755 {} \;

find . -type f -exec chmod 0644 {} \;
like image 41
Mohamed Aldanaf Avatar answered Oct 05 '22 04:10

Mohamed Aldanaf