WordPress 更新外掛 需要 ftp 使用者和密碼

但是自己建立了 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);