For example, when we create a WordPress site in the VPS host, we need to install themes, plugins, etc. online, but when we click download and install, we will have “to perform the requested operation, WordPress needs to access your web server.”. Please enter your FTP login credentials to continue. If you forget your login credentials (such as user name and password), please contact your website hosting provider. “Error prompt. It seems that our VPS does not give enough permission to the site.
How to solve it? For example, we has this problem in building a site in llsmp one click package. How to solve it?
First, authorized directory
chown -R www-data /home/wwwroot/ wpfans.org/html
chmod -R 775 /home/wwwroot/ wpfans.org/html
chmod -R 777 /home/wwwroot/ wpfans.org/html/wp -content/
Replace the red part with the directory of your site
Second, modify WP- config.php Documents
define(“FS_ METHOD”, “direct”);
define(“FS_ CHMOD_ DIR”, 0777);
define(“FS_ CHMOD_ FILE”, 0777);
In WP- config.php Add the above three lines at the end of the file.
In this way, we can download plugins and install themes in the background of WordPress.