

{"id":33,"date":"2021-03-15T21:29:17","date_gmt":"2021-03-15T13:29:17","guid":{"rendered":"https:\/\/www.52dixiaowo.com\/cloud\/?p=33"},"modified":"2021-03-15T21:35:45","modified_gmt":"2021-03-15T13:35:45","slug":"wnmp-%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/www.52dixiaowo.com\/cloud\/post-33.html","title":{"rendered":"wnmp \u73af\u5883\u642d\u5efa"},"content":{"rendered":"\n<p>wnmp \u8868\u793a: Windows + Nginx + Mysql + PHP<\/p>\n\n\n\n<p>\u8fd9\u91cc\u4ec5\u4ecb\u7ecd\u624b\u52a8\u642d\u5efa\u73af\u5883, \u5982\u679c\u662f\u5c0f\u767d\u53ef\u4ee5\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883 <a rel=\"noreferrer noopener\" href=\"https:\/\/www.xp.cn\/windows-panel.html\" data-type=\"URL\" data-id=\"https:\/\/www.xp.cn\/windows-panel.html\" target=\"_blank\">\u5c0f\u76ae\u9762\u677f<\/a>, \u5df2\u652f\u6301 wnmp<\/p>\n\n\n\n<h5>\u5f00\u59cb\u642d\u5efa<\/h5>\n\n\n\n<p>\u5728\u7a7a\u95f4\u8f83\u5927\u7684\u78c1\u76d8\u4e0a, \u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a wnmp \u7684\u6839\u76ee\u5f55, \u7136\u540e\u65b0\u5efa\u5b50\u76ee\u5f55 nginx, mysql, php<\/p>\n\n\n\n<p>Nginx \u7684\u5b89\u88c5, \u8bf7<a rel=\"noreferrer noopener\" href=\"https:\/\/www.52dixiaowo.com\/cloud\/post-17.html\" data-type=\"URL\" data-id=\"https:\/\/www.52dixiaowo.com\/cloud\/post-17.html\" target=\"_blank\">\u53c2\u8003<\/a>, \u63a8\u8350\u4f7f\u7528 1.18 \u7248\u672c<\/p>\n\n\n\n<p>Mysql \u7684\u5b89\u88c5, \u8bf7<a rel=\"noreferrer noopener\" href=\"https:\/\/www.52dixiaowo.com\/database\/post-20.html\" data-type=\"URL\" data-id=\"https:\/\/www.52dixiaowo.com\/database\/post-20.html\" target=\"_blank\">\u53c2\u8003<\/a>, \u63a8\u8350\u4f7f\u7528\u4e91\u6570\u636e\u5e93<\/p>\n\n\n\n<p>php \u7684\u4e0b\u8f7d, \u8bf7\u8df3\u8f6c<a rel=\"noreferrer noopener\" href=\"https:\/\/windows.php.net\/download\/\" data-type=\"URL\" data-id=\"https:\/\/windows.php.net\/download\/\" target=\"_blank\">\u5b98\u7f51<\/a> , \u5176\u4e2d Thread Safe \u7248\u672c\u662f\u5355\u7ebf\u7a0b\u7684, \u800c Non Thread Safe \u867d\u7136\u6027\u80fd\u66f4\u9ad8,\u4f46\u4f3c\u4e4e\u4e0d\u5f97\u5230\u652f\u6301, \u6bd4\u5982 apache \u4e0b\u65e0\u6cd5\u4f7f\u7528, \u8fd9\u91cc\u4f7f\u7528 8.0.2 \u7684 Thread Safe \u7248\u672c, \u589e\u52a0\u517c\u5bb9\u6027<\/p>\n\n\n\n<h5>2 \u6b65\u914d\u7f6e nginx<\/h5>\n\n\n\n<p>\u67e5\u627e location \u8bbe\u7f6e\u6210\u5982\u4e0b, \u9ed8\u8ba4\u6ca1\u6709 index.php , \u6211\u4eec\u628a\u5b83\u52a0\u4e0a\u6765\u652f\u6301php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {\n\troot   html;\n\tindex  index.html index.htm index.php;\n}<\/code><\/pre>\n\n\n\n<p>\u67e5\u627e \/scripts , \u5e76\u628a\u503c\u6539\u6210\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        location ~ \\.php$ {\n            root           html;\n            fastcgi_pass   127.0.0.1:9000;\n            fastcgi_index  index.php;\n            fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n            include        fastcgi_params;\n        }<\/code><\/pre>\n\n\n\n<h5>4 \u6b65\u914d\u7f6e php<\/h5>\n\n\n\n<p>\u6253\u5f00 php.ini , \u627e\u5230 \u5982\u4e0b\u503c, \u5e76\u53bb\u6389\u524d\u9762\u7684\u5206\u53f7, \u5e76\u628a\u53cc\u5f15\u53f7\u7684\u503c\u6539\u4e3a\u771f\u5b9e\u7684\u8def\u5f84,\u5373 &#8220;php\u6839\u76ee\u5f55\\ext&#8221; <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>extension_dir = \"ext\"<\/code><\/pre>\n\n\n\n<p>\u627e\u5230\u5982\u4e0b\u503c, \u5e76\u914d\u7f6e\u4e3a\u4f60\u7684\u771f\u5b9e\u8def\u5f84, \u8fd9\u4e2a\u662f nginx\u7f51\u7ad9\u7684\u771f\u5b9e\u8def\u5f84, \u9ed8\u8ba4\u662fnginx\\html \u76ee\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>doc_root<\/code><\/pre>\n\n\n\n<p>\u67e5\u627e\u5982\u4e0b\u503c, \u53bb\u6389\u5206\u53f7, \u5e76\u6539\u4e3a 0 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cgi.fix_pathinfo<\/code><\/pre>\n\n\n\n<p>\u542f\u7528\u4e00\u4e9b\u6269\u5c55, \u6bd4\u5982 extension=curl , extension=mysqli \u7b49, \u628a\u524d\u9762\u7684\u5206\u53f7 ; \u53bb\u6389\u5373\u53ef<\/p>\n\n\n\n<h5>\u6700\u540e\u4e5f\u662f\u6700\u91cd\u8981\u7684<\/h5>\n\n\n\n<p>\u6253\u5f00 nginx \u7684\u65b9\u6cd5, \u662f\u4f7f\u7528 cmd \u8f93\u5165 start nginx<\/p>\n\n\n\n<p>\u800c\u5982\u4f55\u8ba9 php \u548c nginx \u4e00\u540c\u5de5\u4f5c? \u9700\u8981\u6253\u5f00 php-cgi \u76d1\u542c9000\u7aef\u53e3, \u6b64\u65f6\u8be5\u7aef\u53e3\u9700\u8981\u4e00\u76f4\u5f00\u542f, \u89e3\u51b3\u529e\u6cd5\u5982\u4e0b<\/p>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a startphp.vbs , \u7136\u540e\u8f93\u5165\u5982\u4e0b\u5185\u5bb9(\u8def\u5f84\u81ea\u5df1\u66ff\u6362), \u5373\u53ef\u5b8c\u6210<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CreateObject(\"WScript.Shell\").Run \"php-cgi.exe\u771f\u5b9e\u4f4d\u7f6e -b 127.0.0.1:9000\",0<\/code><\/pre>\n\n\n\n<p>\u5173\u95ed php-cgi.bat ,\u5185\u5bb9\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>taskkill \/F \/IM php-cgi.exe<\/code><\/pre>\n\n\n\n<p>\u5728 nginx \u7684\u6839\u76ee\u5f55\u4e0b, \u521b\u5efa startnginx.bat<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>start nginx<\/code><\/pre>\n\n\n\n<p>\u5728 nginx \u6839\u76ee\u5f55\u4e0b, \u521b\u5efa stopnginx.bat<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nginx -s stop<\/code><\/pre>\n\n\n\n<p>\u5c0f\u767d\u8bf7\u6ce8\u610f : \u521b\u5efa\u597d bat \u548c vbs \u6587\u4ef6\u540e, \u53cc\u51fb\u624d\u6267\u884c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>wnmp \u8868\u793a: Windows + Nginx + Mysql + PHP \u8fd9\u91cc\u4ec5\u4ecb\u7ecd\u624b\u52a8\u642d\u5efa\u73af\u5883, \u5982\u679c\u662f&hellip; <a href=\"https:\/\/www.52dixiaowo.com\/cloud\/post-33.html\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">wnmp \u73af\u5883\u642d\u5efa<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":9,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/posts\/33\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/cloud\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}