403禁止现场上传标识图片

时间:2016-08-15 作者:JavaProphet

上载站点徽标时,我收到一个403禁止的HTTP错误。

此外,Inspect Element预览显示此页面:

enter image description here

在站点本身上,它只是说“http错误”。我尝试禁用nonces,没有改变。我已经做到了chmod -R 750 <web root dir>chown -R www-data:www-data <web root dir> 也是,所以我假设权限不是问题所在。(是的,php fpm和我的web服务器作为www数据运行。)

这是Wordpress稳定版本的默认安装。我也删除了我的插件文件夹,没有更改。我的web服务器是NGINX。

2 个回复
最合适的回答,由SO网友:JavaProphet 整理而成

因此,经过一段时间的调试,我发现发布超过64 KB(16位整数长度)的数据会导致修改后的NGINX无法在FCGI中拆分post数据。修复后,效果很好。

SO网友:bynicolas

A few things come in mind

  • have you checked nginx access/error log? Depending on your distro, log should be located at /var/log/nginx/access.log and /var/log/nginx/error.log.
  • What role is your current WP user when uploading, does it have required capabilities ?
  • Try to change wp-content permission to 755
  • Are you having difficulties only with images file? If so, might be related to Imagick, try setting GD as default image editor. Add this next filter to default to GD in your functions.php. It will return GD before Imagick. The link provided is a plugin doing just that.

.

add_filter( \'wp_image_editors\', \'change_graphic_lib\' );

function change_graphic_lib($array) {
  return array( \'WP_Image_Editor_GD\', \'WP_Image_Editor_Imagick\' );
}