解决方法一
可以在wp-config.php里加入下面代码:
1 | define( "FS_METHOD" , "direct" ); |
2 | define( "FS_CHMOD_DIR" , 0777); |
3 | define( "FS_CHMOD_FILE" , 0777); |
解决方法二
在wp-config.php中找到如下代码:
1 | require_once (ABSPATH . 'wp-settings.php' ); |
在上面代码后面添加以下代码:
2 | add_filter( 'filesystem_method' , create_function( '$a' , 'return "direct";' )); |
3 | define( 'FS_CHMOD_DIR' , 0751); |
解决方法三
拷贝下面的代码到wp-config.php中的?>之前
3 | add_filter( 'filesystem_method' ,create_function( '$a' , 'return "direct";' )); |
4 | define( 'FS_CHMOD_DIR' , 0751); |
解决方法四
修改FTP相关信息之后,拷贝代码到wp-config.php的?>之前
2 | define( 'FTP_HOST' , 'ftp.yoursite.com' ); |
3 | define( 'FTP_USER' , 'Your_FTP_Username' ); |
4 | define( 'FTP_PASS' , 'Your_FTP_password' ); |
6 | define( 'FTP_SSL' , true); |