修复WordPress 上传文件HTTP Error

873Views
No Comments

新装的 WordPress 上传较大的文件时遇到这个问题,我的 WordPress 运行在 Nginx 上,查验之后发现可能是 Nginx 配置的问题。

修改 nginx.conf

sudo vim /etc/nginx/nginx.conf

在配置中增加

http {

#Basic Settings
client_max_body_size 100m;

}

然后重启 nginx :

sudo /etc/init.d/nginx restart

wp-config.php 添加

define( 'WP_MEMORY_LIMIT', '256M' );

php 配置中修改添加

upload_max_filesize = 64M 
post_max_size = 64M 
max_execution_time = 300 
max_input_time = 300

对于 WordPress 无法裁剪图片

apt-get install php7-gd
正文完
 
Comment(No Comments)