wordpress错误ERR_INCOMPLETE_CHUNKED_ENCODING解决方法

在阿里云上,搭建了个nginx服务器,今天wordpress访问不正常,css没有加载成功,后台媒体库也加载不了。Chrome控制台看到如下错误:ERR_INCOMPLETE_CHUNKED_ENCODING。

看了下nginx/logs/error.log下日志:

  1. open() “/aliyun/server/nginx/fastcgi_temp/1/02/0000000021” failed (13: Permission denied) while reading upstream, client: x.x.x.x, server: x.x.x.x, request: “GET /blog/wp-admin/load-styles.php?c=1&dir=ltr&load=dashicons,admin-bar,wp-admin,buttons,wp-auth-check&ver=4.1.1 HTTP/1.1″, upstream: “fastcgi://127.0.0.1:9000”, host: “xx.xx.xx.xx”, referrer: “http://x.x.x.x/blog/wp-admin/”

搜索了下,找到这篇文章http://www.tuicool.com/articles/7Bjiyq跟我遇到的问题类似。

发现nginx目录下fastcgi_temp属于nobody用户和用户组。

  1. drwx—— 12 nobody  nobody    4096 Mar 14 18:24 fastcgi_temp

再看php-fpm配置文件:

  1. #vi /etc/php-fpm.d/www.conf
  2. ; Unix user/group of processes
  3. ; Note: The user is mandatory. If the group is not set, the default user’s group
  4. ;       will be used.
  5. ; RPM: apache Choosed to be able to access some dir as httpd
  6. ;user = nobody
  7. user=www
  8. ; RPM: Keep a group allowed to write in log dir.
  9. ;group = nobody
  10. group=www

用户和用户组已经改成了www。将fastcgi_temp及子目录改为www。如下:

  1. #chown -R www:www fastcgi_temp
  2. #ls -al
  3. drwx—— 12 www  www    4096 Mar 14 18:24 fastcgi_temp

再次访问wordpress,一切正常!

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注