出于安全考虑wordpress默认关闭了对后台的直接升级权限。
在Ubuntu下Apache2使用的www-data和www-data的用户和用户组
正确的步骤是:
1.在wp-content下mkdir tmp然后chmod 777 tmp
修改wp-config.php中增加
define('WP_TEMP_DIR',ABSPATH.'wp-content/tmp');
define("FS_METHOD","direct");
define("FS_CHMOD_DIR",0777);
define("FS_CHMOD_FILE",0777);
2.关键
chown -R www-data:www-data /var/www/yourweb
yourweb替换您的站点目录
3.service apache2 restart
后台测试成功