Reprinted from: WordPress requires FTP user name and password problem
WordPress installation delete plug-in requires FTP user name and password problem
I used the steps 1 and 3 of Method 1 to succeed!
It is recommended to use the first method. The above is just a personal opinion, a plan prepared for the server.
method one:
Server command operation
- Enter the wordpress directory, mine is
/var/www/html/wordpress
cd /var/www/html/wordpress
- Add the following code at the end of wp-config.php under the wordpress directory:
if(is_admin()) {
add_filter('filesystem_method',create_function('$a','return "direct";'));
define('FS_CHMOD_DIR', 0751);
}
2. Set the user and user group of the decompressed wordpress directory to be the same as the file user and user group in it:
Xshell link server, execute under the server:
cd wordpress
ll #(小写LL)
You can see the users and user groups of the files in the wordpress directory:
-rw-r--r-- 1 nob 605 418 Sep 25 2013 index.php
-rw-r--r-- 1 nob 60534 19935 Jan 3 2017 license.txt
Users and user groups are:
`nob:605` (这里替换为你自己的用户和用户组名)
Then set the wordpress directory user and user group:
cd ..
chown nobo:605 wordpress
Perform the above operations under the test, and you're done. If there are still problems, go to step 3.
3. Set the permission of wordpress and wp-content in the directory to 777
chmod -R 777 wp-content
Method Two:
Brute force deletion
Enter wordpress -> wp-content -> themes
to find the appropriate topic names can be deleted.