{"id":4286,"date":"2014-09-15T01:09:11","date_gmt":"2014-09-14T17:09:11","guid":{"rendered":"https:\/\/www.icocean.com\/blog\/?p=4286"},"modified":"2014-09-15T01:27:51","modified_gmt":"2014-09-14T17:27:51","slug":"nginx-1-61php5-fpm%e4%b8%8d%e8%83%bd%e8%a7%a3%e6%9e%90php","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=4286","title":{"rendered":"Nginx 1.61+php5-fpm\u4e0d\u80fd\u89e3\u6790php"},"content":{"rendered":"<p>\u6700\u8fd1\u5c06Nginx\u4ece1.60\u5347\u7ea7\u52301.61\uff0c\u7136\u540e\u53d1\u73b0php\u4e0d\u80fd\u89e3\u6790\u4e86\u3002<br \/>\n\u5207\u6362\u56deApache\uff0c\u5de5\u4f5c\u6b63\u5e38\uff0c\u8bf4\u660e\u4e0d\u662fphp5-fpm\u7684\u95ee\u9898\uff0c\u800c\u786e\u5b9e\u662fnginx\u51fa\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u751f\u4ea7\u73af\u5883\uff0c\u82e5\u8981\u7a33\u5b9a\uff0c\u8fd8\u662fapache\u6bd4\u8f83\u597d\uff0c\u5f88\u591a\u5e74\u4e86\u4ece\u6765\u6ca1\u6709\u51fa\u73b0\u7c7b\u4f3c\u7684\u95ee\u9898\u3002<br \/>\n\u4f46\u662fnginx\u7684\u6027\u80fd\u662f\u6709\u76ee\u5171\u7779\u7684\u3002<\/p>\n<p>\u56de\u5230\u6b63\u9898\uff0cgoogle\u4e86\u4e00\u4e0b\uff0c\u89e3\u51b3\u529e\u6cd5\u5982\u4e0b\uff1a<!--more--><br \/>\nIn 1.6.0 you&#8217;d do something like this to use fastcgi \/ php5-fpm:<br \/>\n    location ~ \\.php$ {<br \/>\n        try_files $uri =404;<br \/>\n        fastcgi_split_path_info ^(.+\\.php)(\/.+)$;<br \/>\n        fastcgi_pass unix:\/var\/run\/php5-fpm.sock;<br \/>\n        fastcgi_index index.php;<br \/>\n        include fastcgi_params;<br \/>\n    }<\/p>\n<p>However after upgrading to 1.6.1, you need to update the include line to this:<br \/>\n        #include fastcgi_params;<br \/>\n        include fastcgi.conf;<\/p>\n<p>\u5df2\u7ecf\u6709\u4eba\u5728\u62a5bug\uff1a<br \/>\n1.6.1\/1.7.4 and newer breaks FastCGI<br \/>\nhttps:\/\/bugs.launchpad.net\/nginx\/+bug\/1366651<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5c06Nginx\u4ece1.60\u5347\u7ea7\u52301.61\uff0c\u7136\u540e\u53d1\u73b0php\u4e0d\u80fd\u89e3\u6790\u4e86\u3002 \u5207\u6362\u56deApache\uff0c\u5de5\u4f5c\u6b63\u5e38\uff0c\u8bf4\u660e\u4e0d\u662fp <a href='https:\/\/www.icocean.com\/blog\/?p=4286' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3981],"tags":[3517,4019],"class_list":["post-4286","post","type-post","status-publish","format-standard","hentry","category-nginx-","tag-nginx","tag-php5-fpm","category-3981-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4286"}],"version-history":[{"count":3,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4286\/revisions"}],"predecessor-version":[{"id":4289,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4286\/revisions\/4289"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}