The entire WP tree should be owned by the same user under which PHP is running. If you have that, then the error you see should go away.
Thanks. How do I check that?
Are you using PHP-FPM on your VPS? If so, what user do you have set for the pool which runs this set? And what user owns the WP file tree?
Sorry for my questions but I’m not an expert in VPS. I didn’t choose to set that up on my website and now I’m trying to figure out a way to install my new website on it…
I have only one user on my vps which is root. I don’t know what PHP-FPM means sorry…
Pardon the suggestion, as you may be using a VPS to learn about Linux, but if you don’t know these things, perhaps a VPS is not the right solution for you. You might do better with either “normal”, shared hosting or a managed WordPress plan on a more powerful platform.
I know and you are 100% right. But I have this vps and paid for it because my former dev chose that. Now I would like to install my new wordpress. I’m sure this error is pretty simple to solve but I havenβt found the solution yet…
Where is your VPS hosted? What flavor of Linux are you using?
It’s a OVH vps. Debian 9.6
-
This reply was modified 6 years, 3 months ago by
tuturgioc.
PHP usually runs as the user wwww-data on Debian, so make sure the wordpress directory tree is chown’d to www-data:www-data.
Note that this isn’t the best way to do things securely, as each website on your VPS should run under a different user, just as each would use a different database with a different user.
Thanks for the advice. In the future I’ll create a new user for any new website.
How do you check the wordpress directory tree?
I really, really suggest you consider that you’re in a hole and stop digging. Your former dev did you no favor. Switch to some other plan at OVH or another host so you’re not the system administrator of the server. If you’d like to go back to that someday, get a cheap vps ($5/month at a place like Digital Ocean) and learn enough Linux to make that happen. Don’t hold your website hostage to your level of Linux knowledge.
It concerns me that you say the only user on your site is root. Logging in frequently as root is a bad idea as it’s really, really (really!) easy to shoot yourself in both feet. You should be using an unprivileged user and using “sudo” whenever you need to do rooty things.
I just created a new user and used the sudo command. I learn fast π
-
This reply was modified 6 years, 3 months ago by
tuturgioc.
I solved the issue with this :
chown -R www-data:www-data /var/www/html
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;