Home  >  Article  >  php教程  >  How to solve the problem that WordPress cannot update automatically in lnmp environment and prompts to fill in FTP information

How to solve the problem that WordPress cannot update automatically in lnmp environment and prompts to fill in FTP information

巴扎黑
巴扎黑Original
2016-11-07 11:17:181119browse

Alibaba Cloud configures LNMP and installs Nginx. I feel that SFTP is also very convenient, and the speed in China is fast enough, so I am too lazy to install FTP and consume resources.

However, when WordPress prompts to upgrade, it cannot be upgraded normally if you click automatic upgrade. It prompts you to enter FTP account and password information. I think you need to install FTP. SFTP should not work, so I don’t care about this. Every time Each time it was upgraded manually.

My friend’s Alibaba Cloud was messed with, and it can be automatically upgraded. There is no FTP installed. When I asked how to do it, I just messed around for a while, and then it was fine, and it was automatically updated. This is sad. , so I have to think of a way and explore it. It seems that SFTP is still possible.

According to users of the LNMP one-click installation package, when WordPress prompts to upgrade, a page for filling in FTP information appears when clicking "Automatic Upgrade". Many of us who use LNMP do not install an FTP server. In fact, the problem that occurs is that the execution identity of Nginx is not the file owner identity.

Solution:

Suppose your WordPress installation directory is /home/wwwroot/zoneself.org

Use Putty to log in to the Linux VPS, execute: chown -R www /home/wwwroot/zoneself.org

Execute the above command You can change the owner of all files under /home/wwwroot/zoneself.org to www. This will solve the problem that FTP must be filled in for automatic updates.

At this point, mine still doesn’t work. It still can’t automatically upgrade. I also need to modify the WordPress configuration file, wp-config.php, and add this line:

define('FS_METHOD', "direct");

Then enter the backend, click on upgrade, and find that the upgrade is successful!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn