但是自己創建了 FTP 之後,卻一直無法連接成功,無法更新
解決的辦法是
方法一:
直接修改 WordPress 配置文件 wp-config.php, 加上以下代碼後就可以在後台正常進行主題、插件安裝了.
if(is_admin())
{
add_filter('filesystem_method',
create_function('$a','return
"direct";'
));
define('FS_CHMOD_DIR',
0751);
}
方法二:
假設你搭建了 ftp, 在下面對應的地方填寫相應的 ftp server 信息.
//*added
ftp login credentials to avoid the annoying prompt asking for login info every time I wanted to upgrade a plugin*
define(『FTP_HOST』,
『ftp.yoursite.com』);
define(『FTP_USER』,
『Your_FTP_Username』);
define(『FTP_PASS』,
『Your_FTP_password』);
//*If
you can use a SSL connection set this to true*
define(『FTP_SSL』,
true);