Levistone > UNIX / Linux > nginx更新したらPHPがトラブった – Ubuntu 14.04.1
nginx更新したらPHPがトラブった – Ubuntu 14.04.1
aptitude full-upgrade とかやってスタタタターンとアップデートしたんだけど nginx が 1.6.1-2 になって、PHP を使っているページが開かなくなった。
とりあえずログを見てみましょー
1 2 3 |
...snip... 2014/09/24 14:52:09 [error] 5349#0: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 2001:470:81ba:cafe:dead:beef:1234:5678, server: www.levistone.net, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "www.levistone.net" ...snip... |
1 2 3 4 5 6 7 8 9 10 |
...snip... Sep 24 15:05:22 misaka13277 kernel: [2601408.454482] traps: php5-fpm[25953] general protection ip:6c60d1 sp:7fffc5a01000 error:0 in php5-fpm[400000 +800000] Sep 24 15:05:25 misaka13277 kernel: [2601410.795786] traps: php5-fpm[25972] general protection ip:6c60d1 sp:7fffc5a01000 error:0 in php5-fpm[400000 +800000] Sep 24 15:05:39 misaka13277 kernel: [2601424.717083] traps: php5-fpm[25850] general protection ip:6c60d1 sp:7fffc5a01000 error:0 in php5-fpm[400000 +800000] Sep 24 15:05:40 misaka13277 kernel: [2601426.198596] traps: php5-fpm[26256] general protection ip:6c60d1 sp:7fffc5a01000 error:0 in php5-fpm[400000 +800000] ...snip... |
ありがちなのは /var/run/php-fpm.sock のパーミッションが nginx と揃ってないとかだけど、今回は違う。
色々やった挙句 apt-listchanges のメール見たら書いてあったわ
nginx-common (1.6.1-2) unstable; urgency=medium As of nginx-1.6.1-2 we have synced all configuration files with upstream and we plan to keep them in sync from now on. Unfortunately that might break existing configuration for some users. Please check the matrix below for more information: File Changes ----------------------- koi-win whitespace koi-utf whitespace mime-types whitespace, changed js/rss mime type, minor other changes & additions scgi_params whitespace, added HTTPS uwsgi_params whitespace, added HTTPS, removed UWSGI_SCHEME fastcgi_params whitespace, removed SCRIPT_FILENAME fastcgi.conf new upstream configuration file Fastcgi configuration issues ============================ nginx shipped a modifiedfastcgi_params
, which declaredSCRIPT_FILENAME
fastcgi_param. This line has now been removed. From now on we are also shipping fastcgi.conf from the upstream repository, which includes a saneSCRIPT_FILENAME
parameter value. So, if you are using fastcgi_params, you can try switching to fastcgi.conf or manually set the relevant params. You might also want to read the documentation section before proceeding. http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html section: $fastcgi_script_name variable. -- Christos Trochalakis <yatiohi@ideopolis.gr> Thu, 28 Aug 2014 14:23:42 +0300
diff 取ったら SCRIPT_FILENAME ってのが無いので追加する必要がある。
または今までの fastcgi_params を fastcgi.conf で置き換える。
# 私は fastcgi_params をリネームしてシンボリックリンクを張った
1 2 3 |
misaka13277# diff fastcgi_params fastcgi.conf 1a2 > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
1 2 3 |
misaka13277# mv fastcgi_params fastcgi_params.bak misaka13277# ln -s fastcgi.conf fastcgi_params misaka13277# service nginx restart |
めでたし