<br />
<b>Warning</b>:  Undefined array key "HTTP_ACCEPT_LANGUAGE" in <b>/www/wwwroot/01xj.net/wp-content/plugins/wp-ue/main.php</b> on line <b>13</b><br />
{"id":66,"date":"2011-09-13T13:58:26","date_gmt":"2011-09-13T13:58:26","guid":{"rendered":"http:\/\/www.01xj.net\/0\/?p=66"},"modified":"2011-09-13T14:02:50","modified_gmt":"2011-09-13T14:02:50","slug":"windows%e4%b8%8bnginxphp5fastcgi%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e8%af%a6%e8%a7%a3-2","status":"publish","type":"post","link":"https:\/\/www.01xj.net\/?p=66","title":{"rendered":"Windows\u4e0bNginx+PHP5(FastCgi)\u5b89\u88c5\u914d\u7f6e\u8be6\u89e3"},"content":{"rendered":"<p id=\"ctrlfssummary\">\u6838\u5fc3\u63d0\u793a\uff1aNginx\u4f5c\u4e3a\u4e00\u6b3e\u652f\u6301PHP\u7684\u8f7b\u91cf\u7ea7WEB\u670d\u52a1 \u5668\uff0c\u5728PHP\u7f51\u7ad9\u5efa\u8bbe\u4e2d\u6536\u5230\u8d8a\u6765\u8d8a\u591a\u7684\u5e94\u7528\uff0c\u6700\u8fd1\u5728Windows\u5e73\u53f0\u4e0a\u5b89\u88c5\u914d\u7f6e\u4e86Nginx+PHP5\u7684\u8fd0\u884c\u73af\u5883\uff0c\u975e\u5e38\u65b9\u4fbf\uff0c\u73b0\u8be6\u7ec6\u4ecb\u7ecd\u4e0b Windows\u4e0bNginx\u914d\u7f6ePHP5\u7684\u57fa\u7840\u6559\u7a0b\uff0cNginx\u914d\u7f6ePHP\u662f\u4ee5FastCgi\u65b9\u5f0f\u914d\u7f6e\u7684\u3002<\/p>\n<p>Nginx\u4f5c\u4e3a\u4e00\u6b3e\u652f\u6301PHP\u7684\u8f7b\u91cf\u7ea7WEB\u670d\u52a1\u5668\uff0c\u5728PHP\u7f51\u7ad9\u5efa\u8bbe\u4e2d\u6536\u5230\u8d8a\u6765\u8d8a\u591a\u7684\u5e94\u7528\uff0c\u6700\u8fd1\u5728 Windows\u5e73\u53f0\u4e0a\u5b89\u88c5\u914d\u7f6e\u4e86Nginx+PHP5\u7684\u8fd0\u884c\u73af\u5883\uff0c\u975e\u5e38\u65b9\u4fbf\uff0c\u73b0\u8be6\u7ec6\u4ecb\u7ecd\u4e0bWindows\u4e0bNginx\u914d\u7f6ePHP5\u7684\u57fa\u7840\u6559\u7a0b\uff0cNginx \u914d\u7f6ePHP\u662f\u4ee5FastCgi\u65b9\u5f0f\u914d\u7f6e\u7684\u3002<\/p>\n<p><strong>\u4e0b\u8f7dNginx<\/strong><\/p>\n<p>Nginx\u53ef\u4ee5\u5728\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u914d\u7f6e\uff0c\u6211\u4f7f\u7528\u7684\u662fWindows\uff0c\u6240\u4ee5\u9700\u8981\u4e0b\u8f7dNginx Windows\u7248\u672c\uff0c\u70b9\u51fb<a title=\"\u4e0b\u8f7dNginx\u5b89\u88c5\u5305\" href=\"http:\/\/nginx.org\/en\/download.html\" target=\"_blank\">\u4e0b\u8f7dNginx<\/a>\u3002\u6211\u4e0b\u8f7d\u7684\u662fnginx\/Windows-0.8.53\u7248\u672c\u3002<\/p>\n<p><strong>\u5b89\u88c5Nginx<\/strong><\/p>\n<p>\u4e0b\u8f7d\u5b8cNginx\u540e\uff0c\u9700\u8981\u5728Windows\u4e2d\u5b89\u88c5Nginx\uff0cNginx Windows\u7248\u672c\u7684\u5b89\u88c5\u975e\u5e38\u65b9\u4fbf\uff0c\u53ea\u8981\u89e3\u538b\u7f29\u540e\uff0c\u5c06\u6587\u4ef6\u62f7\u8d1d\u5230C\u76d8\u6839\u76ee\u5f55\u4e0b\u5373\u53ef\uff0c\u6211\u7684Nginx\u5b89\u88c5\u76ee\u5f55\u4e3aC\uff1a\\nginx-0.8.53\u3002<\/p>\n<p><strong>\u5b89\u88c5\u914d\u7f6ePHP<\/strong><\/p>\n<p>\u6211\u4f7f\u7528\u7684\u662fPHP5.2\uff0c\u4f60\u53ef\u4ee5\u53ef\u4ee5\u4f7f\u7528PHP5.3\uff0c\u53ea\u8981PHP\u7248\u672c\u652f\u6301FastCgi\u65b9\u5f0f\uff08\u6709php-cgi.exe\uff09\u5373\u53ef\uff0cPHP\u5b89\u88c5\u914d\u7f6e\u6559\u7a0b\u63a8\u8350\u53c2\u8003\uff1a<a href=\"https:\/\/www.01xj.net\/0\/?p=68\" target=\"_blank\">Windows7 IIS7\u4e0b\u4ee5FastCgi\u548cISAPI\u65b9\u6cd5\u5b89\u88c5\u914d\u7f6ePHP5\u6559\u7a0b<\/a><\/p>\n<p><strong>\u914d\u7f6eNginx\u652f\u6301\u8fd0\u884cPHP<\/strong><\/p>\n<p>\u9996\u5148\u9700\u8981\u6253\u5f00C\uff1a\\nginx-0.8.53\uff0c\u627e\u5230C\uff1a\\nginx-0.8.53\\conf\u76ee\u5f55\u4e0b\u7684nginx.conf\uff0c\u4ee5\u8bb0\u4e8b\u672c\u6253\u5f00\uff0c<\/p>\n<p><strong>\u914d\u7f6eNginx\u652f\u6301PHP\u7b2c\u4e00\u6b65<\/strong><\/p>\n<p>\u8bbe\u5b9aerror.log\u7684\u5b58\u653e\u76ee\u5f55\uff0c\u5c06#error_log logs\/error.log;\u7684#\u53bb\u5904\uff0c\u9ed8\u8ba4error.log\u662f\u5b58\u653e\u5728Nginx\u5b89\u88c5\u76ee\u5f55\u4e2dlogs\u76ee\u5f55\u4e0b\u3002<\/p>\n<p><strong>\u914d\u7f6eNginx\u652f\u6301PHP\u7b2c\u4e8c\u6b65<\/strong><\/p>\n<p>\u8bbe\u5b9aWEB\u670d\u52a1\u5668\u76ee\u5f55\uff0c\u7c7b\u4f3c\u4e8ePHP.INI\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684document_root\uff0cNginx\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u539f\u6709\u4fe1\u606f\u5982\u4e0b<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">location \/ {<br \/>\nroot \u00a0 html;<br \/>\nindex \u00a0index.html index.htm;<br \/>\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4fee\u6539Nginx\u914d\u7f6e\u5982\u4e0b<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">location \/ {<br \/>\nroot \u00a0 D:\/PHPWeb;<br \/>\nindex \u00a0index.php index.html index.htm;<br \/>\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0c\u8def\u5f84\u5206\u9694\u7b26\u8bf7\u4f7f\u7528\u201d\/\u201d\u800c\u4e0d\u8981\u4f7f\u7528Windows\u4e2d\u7684\u201d\\\u201d\u4ee5\u9632\u6b67\u4e49\u3002<\/p>\n<p><strong>\u914d\u7f6eNginx\u652f\u6301PHP\u7b2c\u4e09\u6b65<\/strong><\/p>\n<p>\u5728Nginx\u914d\u7f6e\u6587\u4ef6\u4e2d\u627e\u5230<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>\n<p>#location ~ \\.php$ {# \u00a0 \u00a0root \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 html;<\/p>\n<p># \u00a0 \u00a0fastcgi_pass \u00a0 127.0.0.1:9000;<\/p>\n<p># \u00a0 \u00a0fastcgi_index \u00a0index.php;<\/p>\n<p># \u00a0 \u00a0fastcgi_param \u00a0SCRIPT_FILENAME \u00a0\/scripts$fastcgi_script_name;<\/p>\n<p># \u00a0 \u00a0include \u00a0 \u00a0 \u00a0 \u00a0fastcgi_params;<\/p>\n<p>#}<\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53bb\u5904#\u5e76\u6dfb\u52a0WEB\u76ee\u5f55\uff0c\u5373<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">\n<div>\n<p>location ~ \\.php$ {root \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 D:\/PHPWeb;<\/p>\n<p>fastcgi_pass \u00a0 127.0.0.1:9000;<\/p>\n<p>fastcgi_index \u00a0index.php;<\/p>\n<p>fastcgi_param \u00a0SCRIPT_FILENAME \u00a0D:\/PHPWeb$fastcgi_script_name;<\/p>\n<p>include \u00a0 \u00a0 \u00a0 \u00a0fastcgi_params;<\/p>\n<p>}<\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff0c\u9700\u8981\u5c06<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">fastcgi_param \u00a0SCRIPT_FILENAME\u00a0\u00a0\u00a0\/scripts$fastcgi_script_name;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e2d\u7684\/scripts\u4fee\u6539\u4e3a\u4e4b\u524d\u8bbe\u5b9a\u7684WEB\u76ee\u5f55\uff0c\u5426\u5219\u4f1a\u62a5HTTP 404\u9519\u8bef\u3002<\/p>\n<p><strong>\u914d\u7f6eNginx\u652f\u6301PHP\u7b2c\u4e09\u6b65<\/strong><\/p>\n<p>\u4fee\u6539PHP.INI\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684cgi.fix_pathinfo = 1\uff0cPHP \u4f1a\u4fee\u6b63 SCRIPT_FILENAME \u4e3a\u771f\u5b9e\u7684\u6587\u4ef6\u5730\u5740\uff0c\u5426\u5219 PHP \u5c06\u65e0\u6cd5\u627e\u5230\u9700\u8981\u5904\u7406\u7684 PHP \u6587\u4ef6\u3002<\/p>\n<p>\u81f3\u6b64\uff0cNginx\u652f\u6301\u8fd0\u884cPHP\u7684\u57fa\u7840\u914d\u7f6e\u5de5\u4f5c\u5c31\u597d\u4e86\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u542f\u52a8PHP FastCgi\u548cNginx\u670d\u52a1\u4ee5\u4fbf\u8fd0\u884cPHP\u7a0b\u5e8f\uff0c\u65b9\u6cd5\u5982\u4e0b<\/p>\n<p>1\u3001\u9996\u5148<a title=\"\u4e0b\u8f7dRunHiddenConsole.exe\" href=\"http:\/\/blogbuildingu.com\/files\/RunHiddenConsole.zip\" target=\"_blank\">\u4e0b\u8f7dRunHiddenConsole.exe<\/a><\/p>\n<p>2\u3001\u542f\u52a8PHP FastCgi\uff0c\u5728CMD\u6a21\u5f0f\u4e0b\u8f93\u5165<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">RunHiddenConsole C:\/php52iis\/php-cgi.exe -b 127.0.0.1:9000 -c C:\/windows\/php.ini<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f\u4f60\u7684PHP\u5b89\u88c5\u76ee\u5f55\uff0c\u4ee5\u53caphp.ini\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>3\u3001\u542f\u52a8Nginx\u670d\u52a1\uff0c\u5373\u5728CMD\u6a21\u5f0f\u4e0b\u8f93\u5165<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\">C:\/nginx-0.8.53\/nginx.exe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u81f3\u6b64Windows\u4e0b\u914d\u7f6eNginx\u4ee5\u652f\u6301\u8fd0\u884cPHP\u7684\u57fa\u7840\u914d\u7f6e\u65b9\u6cd5\u5c31\u5b8c\u6210\u4e86\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7phpinfo\u51fd\u6570\u67e5\u770b\u5230\u6b64\u65f6\u8fd0\u884cPHP\u7684WEB\u670d\u52a1\u5668\u53d8\u6210\u4e86Nginx\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6838\u5fc3\u63d0\u793a\uff1aNginx\u4f5c\u4e3a\u4e00\u6b3e\u652f\u6301PHP\u7684\u8f7b\u91cf\u7ea7WEB\u670d\u52a1 \u5668\uff0c\u5728PH&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-web","category-3"],"_links":{"self":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66"}],"version-history":[{"count":2,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}