{"id":30527,"date":"2023-02-15T06:22:40","date_gmt":"2022-12-28T11:19:27","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/"},"modified":"2025-08-12T19:36:22","modified_gmt":"2025-08-12T11:36:22","slug":"nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/","title":{"rendered":"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4eca\u56de\u306fNginx\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u4f5c\u696d\u3092\u3057\u3066\u3044\u3066\u30cf\u30de\u30ea\u3069\u3053\u308d\u3001\u5b9f\u969b\u306b\u30cf\u30de\u3063\u305f\u70b9\u3092\u5143\u306b\u307e\u3068\u3081\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Nginx1.4\u7cfb\u304b\u30891.10\u7cfb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3067\u8a66\u3057\u3066\u307f\u305f<\/ul>\n<h1>\u662f\u7531\u4ec0\u9ebc\u7d44\u6210\u7684\uff1f<\/h1>\n<p>\u6211\u6b63\u4f7f\u7528Nginx + php-fpm + php\u6784\u5efaweb\u670d\u52a1\u5668\uff0c\u8bd5\u56fe\u5347\u7ea7Nginx\u7684\u7248\u672c\u3002<\/p>\n<h1>\u5347\u7ea7 j\u00ed)<\/h1>\n<p>\u6211\u6b63\u5728\u901a\u8fc7Chef\u4f7f\u7528nginx-build\u8fdb\u884c\u5347\u7ea7<br \/>\nhttps:\/\/github.com\/cubicdaiya\/nginx-build<\/p>\n<h2>nginx-build\u662f\u6307\u7684\u662f\u4ec0\u4e48\uff1f<\/h2>\n<h1>\u8ff7\u4f4f\u4e86\u7684\u65b9\u9762 le de<\/h1>\n<p>\u4e00\u5207\u6e90\u4e8e\u4e0b\u9762\u7684 Nginx \u9519\u8bef\u65e5\u5fd7\u3002<\/p>\n<pre class=\"post-pre\"><code>yyyy\/mm\/dd hh:mm:ss [crit] 14114#0: *7 connect() to unix:\/var\/run\/php-fpm\/php-fpm.sock failed (13: Permission denied)\r\n<\/code><\/pre>\n<h2>The reason<\/h2>\n<ol>\u7b80\u5355\u6765\u8bf4\uff0cnginx\u5728\u6784\u5efa\u65f6\u7684\u7528\u6237\u548c\u7ec4\u8bbe\u7f6e\u4e0d\u5b8c\u6574\u3002<\/ol>\n<ul class=\"post-ul\">nginx\u306ebuild\u6642\u306euser,group\u306e\u8a2d\u5b9a<\/ul>\n<pre class=\"post-pre\"><code>nginx-build \\\r\n      -d work \\\r\n      -v #{nginx_version} \\\r\n\u3000    --user=nginx \\  \u3053\u3053\u306e\u8a2d\u5b9a\u304c\u629c\u3051\u3066\u305f\r\n      --group=nginx \\ \u3053\u3053\u306e\u8a2d\u5b9a\u304c\u629c\u3051\u3066\u305f\r\n      .\r\n      .\r\n      .\r\n<\/code><\/pre>\n<ul class=\"post-ul\">php-fpm\u3067\u306f\u4e0b\u8a18\u306e\u8a2d\u5b9a\u304c\u3055\u308c\u3066\u3044\u308b<\/ul>\n<pre class=\"post-pre\"><code>listen.owner = nginx\r\nlisten.group = nginx\r\n<\/code><\/pre>\n<p>\u55ef\uff0c\u6211\u8ba4\u4e3a\u4f60\u53ef\u4ee5\u4fee\u6539\/etc\/php-fpm.d\/www.conf\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4e0d\u8fc7\u6700\u597d\u91cd\u65b0\u8fdb\u884cNginx\u7684\u7f16\u8bd1\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>php\uff0cphp-fpm\u7684\u5957\u63a5\u5b57\u6743\u9650\uff0c\u4e0b\u9762\u7684\u4fe1\u606f\u662f\u539f\u59cb\u7684\uff0c\u4f46\u9ed8\u8ba4\u8bbe\u7f6e\u7684\u6743\u9650\u8bbe\u7f6e\u5df2\u7ecf\u6539\u53d8\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2014-0185<\/ol>\n<p>\u5982\u679c\u6240\u6709\u8bbf\u95ee\u5747\u901a\u8fc7\u672c\u5730\u7528\u6237\u8fdb\u884c\u5e76\u4fdd\u8bc1\u5b89\u5168\uff0c\u90a3\u4e48\u4ee5\u524d\u7684666\u4f3c\u4e4e\u662f\u53ef\u884c\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>listen.mode = 0666\r\n<\/code><\/pre>\n<h1>\u5176\u4ed6\u5907\u6ce8<\/h1>\n<ul class=\"post-ul\">Nginx\u306eDefault\u306econfig\u306b\u4f55\u304b\u5909\u66f4\u70b9\u3068\u304b\u3042\u308b\u304b\u306a\u3041\u3068\u601d\u3063\u305f\u3051\u3069\u307b\u307c\u306a\u304b\u3063\u305f<\/ul>\n<h1>\u6700\u540e<\/h1>\n<p>\/etc\/php-fpm.d\/www.conf\u306e\u8a2d\u5b9a\u3070\u304b\u308a\u7591\u3063\u3066\u3044\u3066nginx\u306ebuild\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u4ed6\u306a\u3089\u306a\u304b\u3063\u305f\u4e8b\u306b\u6c17\u4ed8\u304b\u305a\u6d88\u8017\u3057\u305f<br \/>\n\u307f\u306a\u3055\u3093\u540c\u3058\u8f4d\u3092\u8e0f\u307e\u306c\u3088\u3046\u306b\u516c\u958b\u3057\u3066\u304a\u304f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u4eca\u56de\u306fNginx\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u4f5c\u696d\u3092\u3057\u3066\u3044\u3066\u30cf\u30de\u30ea\u3069\u3053\u308d\u3001\u5b9f\u969b\u306b\u30cf\u30de\u3063\u305f\u70b9\u3092\u5143\u306b\u307e\u3068\u3081\u307e\u3059 &#038;nbs [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-30527","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-28T11:19:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T11:36:22+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/\",\"name\":\"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-12-28T11:19:27+00:00\",\"dateModified\":\"2025-08-12T11:36:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"description\":\"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879 - Blog - Silicon Cloud","description":"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\/","og_locale":"zh_CN","og_type":"article","og_title":"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879","og_description":"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-12-28T11:19:27+00:00","article_modified_time":"2025-08-12T11:36:22+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/","name":"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-12-28T11:19:27+00:00","dateModified":"2025-08-12T11:36:22+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"description":"\u5173\u4e8eNginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Nginx\u3001php-fpm\u3001php\u5347\u7ea7\u65f6\u7684\u6ce8\u610f\u4e8b\u9879"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/nginx%e3%80%81php-fpm%e3%80%81php%e5%8d%87%e7%ba%a7%e6%97%b6%e7%9a%84%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=30527"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30527\/revisions"}],"predecessor-version":[{"id":85885,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30527\/revisions\/85885"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=30527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=30527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=30527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}