但是自己创建了FTP之后,却一直无法连接成功,无法更新
解决的办法是
方法一:
直接修改wordpress配置文件wp-config.php,加上以下代码后就可以在后台正常进行主题、插件安装了.
1
2
3
@H_301_38@
4
|
if
(is_admin()) {
add_filter(
'filesystem_method'
,create_function(
'$a'
PHP plain" style="word-break:break-word; padding:0px!important; margin:0px!important; border:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.1em!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; font-family:Consolas,
'return "direct";'
));
define(
'FS_CHMOD_DIR'
PHP plain" style="word-break:break-word; padding:0px!important; margin:0px!important; border:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.1em!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; font-family:Consolas,0751);
}
|
方法二:
假设你搭建了ftp,在下面对应的地方填写相应的ftp server信息.
5
6
//*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);