LEMP + Wordpress = how to configure for Wordpress update?

I have successfully installed LEMP and Wordpress. I'm now trying to get the upgrade function to work properly within the Wordpress (new versions of Wordpress and plugins).

How can I set this up without using ftp?

3 Replies

chown the wordpress file to be owned by the web server then when you're done chown them back to the original user

i.e.

chown -R www-data /path/to/wordpress

…do update…

chown -R fred /path/to/wordpress

Or run PHP as user (cgi,suphp,suexec.. )

Are you getting a error message asking for "your credentials"? If that's the case, don't even try, that's a legendary bug in wordpress that had no solution (believe me). As obs said, the problem is caused because the webserver isn't capable to write the wordpress directory.

To solve that you can try to give "ownership" to the nginx user (www-data in ubuntu/debian, http in arch linux…) or give group write permission, create a new group, change the group of the wordpress directory to the recent group and then make sure the nginx user is part of it.

Be advised that the web server have to be capable of write not only the "wordpress dir", also the "document root".

(In my example, the document root is folder websites)

cd /path/where/you/host/your/websites
cd ..
chmod -R g+rs websites
groupadd wordpress
chgrp -R wordpress websites

The "g+rs" is to make the folder "sticky", that means every file created will keep the current directory group, so, every new file will be in the wordpress group.

A bit longer solution, but I found more elegant =P

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct