wordpress 使用ftp安装插件时权限不足问题解决

使用FTP软件连接FTP空间,进入wp-content目录,新建tmp文件夹,设置文件夹的权限为777

下载:在FTP中返回网站根目录,找到wp-config.php这个PHP文件,下载到本地

修改:在wp-config.php中添加下列三行代码:

define(‘WP_TEMP_DIR’, ABSPATH.’wp-content/tmp’);/* WordPress的临时目录。*/

define(“FS_METHOD”, “direct”);

define(“FS_CHMOD_DIR”, 0777);

define(“FS_CHMOD_FILE”, 0777);

注意:要在定义ABSPATH的后面,即在它的后面添加

if ( !defined(‘ABSPATH’) )

define(‘ABSPATH’, dirname(FILE) . ‘/’);

================================

最后的代码应该是:

if ( !defined(‘ABSPATH’) )

    define('ABSPATH', dirname(__FILE__) . '/');

define(‘WP_TEMP_DIR’, ABSPATH.’wp-content/tmp’);

define(“FS_METHOD”, “direct”);

define(“FS_CHMOD_DIR”, 0777);

define(“FS_CHMOD_FILE”, 0777);

This entry was posted in 运维相关. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.