{"id":265,"date":"2013-02-06T13:58:30","date_gmt":"2013-02-06T05:58:30","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=265"},"modified":"2013-02-07T10:39:11","modified_gmt":"2013-02-07T02:39:11","slug":"windowns2012-%e9%85%8d%e7%bd%ae-nginxphpmysql-%e4%bb%a5%e5%8f%8a%e5%8a%a0%e8%bd%bd%e5%88%b0%e6%9c%8d%e5%8a%a1%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=265","title":{"rendered":"windowns2012 \u914d\u7f6e nginx\\php\\mysql \u4ee5\u53ca\u52a0\u8f7d\u5230\u670d\u52a1\u9879"},"content":{"rendered":"<p>\u7b2c\u4e00\u6b21win\u5e73\u53f0\u642d\u5efa<\/p>\n<p>\u4e0b\u8f7d\u5982\u4e0b\u8f6f\u4ef6<\/p>\n<p>http:\/\/nginx.org\/download\/nginx-1.3.12.zip<\/p>\n<p>http:\/\/windows.php.net\/downloads\/releases\/php-5.4.11-Win32-VC9-x86.zip<\/p>\n<p>http:\/\/cdn.mysql.com\/Downloads\/MySQL-5.6\/mysql-5.6.10-winx64.zip<\/p>\n<p>nginx \u4ee5\u53caphp\u5747\u4e3a\u89e3\u538b\u7f29\u7248\u672c\uff0cmysql\u81ea\u884c\u5b89\u88c5\uff0c\u4e0d\u9700\u8981\u8d58\u8ff0\u3002<\/p>\n<p>nginx\u8def\u5f84 d:\\nginx<\/p>\n<p>php\u8def\u5f84 d:\\php<\/p>\n<p>nginx\u914d\u7f6e\u6587\u4ef6<\/p>\n<blockquote><p>server {<br \/>\nlisten 80;<br \/>\nserver_name localhost;<\/p>\n<p>#charset koi8-r;<\/p>\n<p>#access_log logs\/host.access.log main;<\/p>\n<p>location \/ {<br \/>\nroot d:\\WebRoot;<br \/>\nindex index.html index.htm index.php;<br \/>\n}<\/p>\n<p>......<\/p>\n<p>location ~ \\.php$ {<br \/>\nroot d:\\WebRoot;<br \/>\nfastcgi_pass 127.0.0.1:9000;<br \/>\nfastcgi_index index.php;<br \/>\nfastcgi_param SCRIPT_FILENAME d:\\WebRoot$fastcgi_script_name;<br \/>\ninclude fastcgi_params;<\/p>\n<p>}<\/p><\/blockquote>\n<p>PHP\u914d\u7f6e<\/p>\n<p>extension=php_mysql.dll<br \/>\nextension=php_mysqli.dll<br \/>\nextension=php_gd2.dll<br \/>\nextension=php_mcrypt.dll<br \/>\nextension=php_mbstring.dll<\/p>\n<p>\u6ce8\u91ca\u53bb\u6389\u3002<\/p>\n<p>\u4fee\u6539\u201cextension_dir = \"d:\/php\/ext\"\u201d<\/p>\n<p>\u4fee\u6539\u201cdate.timezone = PRC\u201d<\/p>\n<p>\u8bbe\u7f6enginx\u4e3a\u7cfb\u7edf\u670d\u52a1\uff1a<\/p>\n<p>\u65b9\u6cd5\uff1a\u4e0b\u8f7d\u5982\u4e0b\u8f6f\u4ef6<\/p>\n<p>http:\/\/download.java.net\/maven\/2\/com\/sun\/winsw\/winsw\/1.9\/winsw-1.9-bin.exe<\/p>\n<p>\u91cd\u547d\u540d\u4e3a winsw.exe \uff0c\u590d\u5236\u5230 d:\\nginx<\/p>\n<p>\u8fd9\u91cc\u53ef\u80fd\u4f1a\u6709\u7cfb\u7edf\u63d0\u793a\u7f3a\u5c11pthreadGC2.dll\uff0c\u7f51\u4e0a\u4e0b\u8f7d\u4e00\u4e2a\uff0c\u653e\u5230winsw\u65c1\u8fb9\u5373\u53efhttp:\/\/61.191.188.101:84\/soft2\/dll\/pthreadgc2.zip<\/p>\n<p>\u65b0\u5efa winsw.xml<\/p>\n<blockquote><p>&lt;service&gt;<br \/>\n&lt;id&gt;nginx&lt;\/id&gt;<br \/>\n&lt;name&gt;nginx&lt;\/name&gt;<br \/>\n&lt;description&gt;nginx&lt;\/description&gt;<br \/>\n&lt;executable&gt;d:\\nginx\\nginx.exe&lt;\/executable&gt;<br \/>\n&lt;logpath&gt;d:\\nginx\\&lt;\/logpath&gt;<br \/>\n&lt;logmode&gt;roll&lt;\/logmode&gt;<br \/>\n&lt;depend&gt;&lt;\/depend&gt;<br \/>\n&lt;startargument&gt;-p d:\\nginx&lt;\/startargument&gt;<br \/>\n&lt;stopargument&gt;-p d:\\nginx -s stop&lt;\/stopargument&gt;<br \/>\n&lt;\/service&gt;<\/p><\/blockquote>\n<p>\u4fdd\u5b58\u540e\uff0c\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\u6267\u884c<\/p>\n<p>D:\\nginx&gt;winsw install<\/p>\n<p>\u7cfb\u7edf\u670d\u52a1\u5b89\u88c5\u5b8c\u6bd5\u3002\uff08\u5378\u8f7d\u7cfb\u7edf\u670d\u52a1\u8bf7\u5148\u5173\u95ed2\u4e2anginx\u8fdb\u7a0b\uff0c\u6267\u884c\u00a0D:\\nginx&gt;winsw uninstall\uff09<\/p>\n<p>phpcgi\u6a21\u5f0f\u7684\u6267\u884c\uff1a<\/p>\n<p>\u56e0\u4e3aphpcgi\u7684\u7a33\u5b9a\u6027\u4e0d\u597d\uff0c\u4e00\u822c\u91c7\u7528\u5b88\u62a4\u8fdb\u7a0b\u65b9\u5f0f\uff0c\u5e38\u89c1\u7684\u662f\u6279\u5904\u7406\u547d\u4ee4\u3002\u8fd9\u91cc\u91c7\u7528xxfpm\u7684\u63d2\u4ef6<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/xiaoxia.org\/upfiles\/2011\/02\/xxfpm.zip\uff08\u8fd9\u91cc\u611f\u8c22xiaoxia\u8001\u5927\uff09<\/p>\n<p>\u53d6\u51faxxfpm.exe\u4ee5\u53caxxfpm\u4e24\u4e2a\u6587\u4ef6\uff0c\u590d\u5236\u5230d:\\php<\/p>\n<p>\u540c\u65f6\uff0c\u590d\u5236\u4e4b\u524d\u7684winsw\u3001pthreadGC2.dll\u4ee5\u53cawinsw.xml\u5230d:\\php\uff0c\u5229\u7528\u6b64\u5de5\u5177\u52a0\u8f7d\u5230\u81ea\u542f\u52a8\u670d\u52a1\uff0c\u7f16\u8f91winsw.xml<\/p>\n<blockquote><p>&lt;service&gt;<br \/>\n&lt;id&gt;PHP-fpm&lt;\/id&gt;<br \/>\n&lt;name&gt;Php&lt;\/name&gt;<br \/>\n&lt;description&gt;php \u5b88\u62a4\u8fdb\u7a0b&lt;\/description&gt;<br \/>\n&lt;executable&gt;d:\\php\\xxfpm.exe&lt;\/executable&gt;<br \/>\n&lt;logpath&gt;d:\\php\\&lt;\/logpath&gt;<br \/>\n&lt;logmode&gt;roll&lt;\/logmode&gt;<br \/>\n&lt;depend&gt;&lt;\/depend&gt;<br \/>\n&lt;startargument&gt;\"d:\/php\/php-cgi.exe -c d:\/php\/php.ini\" -n 3 -i 127.0.0.1 -p 9000&lt;\/startargument&gt;<br \/>\n&lt;\/service&gt;<\/p><\/blockquote>\n<p>\u4fdd\u5b58\u540e\uff0c\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\u6267\u884c<\/p>\n<p>D:\\php&gt;winsw install<\/p>\n<p>ok\u7cfb\u7edf\u670d\u52a1\u5b89\u88c5\u5b8c\u6bd5\u3002<\/p>\n<p>\u91cd\u542f\u7535\u8111\uff0c\u6d4b\u8bd5\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u6b21win\u5e73\u53f0\u642d\u5efa \u4e0b\u8f7d\u5982\u4e0b\u8f6f\u4ef6 http:\/\/nginx.org\/download\/nginx-1.3.1\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=265\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-265","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265"}],"version-history":[{"count":3,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions"}],"predecessor-version":[{"id":271,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions\/271"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}