{"id":40469,"date":"2025-05-29T08:06:36","date_gmt":"2025-05-29T00:06:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40469.html"},"modified":"2025-05-29T08:06:36","modified_gmt":"2025-05-29T00:06:36","slug":"wnmp%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba%e4%b8%8e%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40469.html","title":{"rendered":"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e"},"content":{"rendered":"<p>  \u672c\u6587\u8fd8\u6709\u914d\u5957\u7684\u7cbe\u54c1\u8d44\u6e90&#xff0c;\u70b9\u51fb\u83b7\u53d6  <img decoding=\"async\" alt=\"menu-r.4af5f7ec.gif\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b4eaa4.gif\" style=\"width:16px;margin-left:4px;vertical-align:text-bottom;cursor:text\" \/> <\/p>\n<p> \u7b80\u4ecb&#xff1a;WNMP\u73af\u5883\u642d\u5efa\u662f\u5728Windows\u7cfb\u7edf\u4e0a\u5b89\u88c5Nginx\u3001MySQL\u548cPHP&#xff0c;\u5efa\u7acb\u672c\u5730Web\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u548c\u6d4b\u8bd5\u5e73\u53f0\u7684\u8fc7\u7a0b\u3002\u672c\u6307\u5357\u8be6\u7ec6\u63cf\u8ff0\u4e86\u4ece\u4e0b\u8f7d\u8f6f\u4ef6\u3001\u5b89\u88c5\u914d\u7f6e\u5230\u6d4b\u8bd5\u8fd0\u884c\u7684\u6574\u4e2a\u6d41\u7a0b&#xff0c;\u5e76\u5bf9\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u548c\u4f18\u5316\u672c\u5730\u670d\u52a1\u5668\u73af\u5883\u3002 <img decoding=\"async\" alt=\"WNMP\u73af\u5883\u642d\u5efa\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b5970a.png\" \/> <\/p>\n<h2> 1. WNMP\u73af\u5883\u642d\u5efa\u610f\u4e49 <\/h2>\n<h3> WNMP\u73af\u5883\u6982\u8ff0 <\/h3>\n<p> WNMP\u662f\u4e00\u4e2a\u7531Nginx\u3001MySQL\u548cPHP\u6784\u6210\u7684Web\u670d\u52a1\u5668\u73af\u5883&#xff0c;\u5b83\u4e3a\u52a8\u6001\u7f51\u7ad9\u548cWeb\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u3001\u8f7b\u91cf\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5728\u5f53\u4eca\u4e92\u8054\u7f51\u5e94\u7528\u7684\u5f00\u53d1\u4e0e\u90e8\u7f72\u4e2d&#xff0c;WNMP\u73af\u5883\u4ee5\u5176\u5feb\u901f\u3001\u7a33\u5b9a\u548c\u6613\u4e8e\u914d\u7f6e\u7684\u7279\u70b9&#xff0c;\u9010\u6e10\u6210\u4e3a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002 <\/p>\n<h3> WNMP\u73af\u5883\u7684\u91cd\u8981\u6027 <\/h3>\n<p> WNMP\u73af\u5883\u7684\u91cd\u8981\u4e4b\u5904\u5728\u4e8e\u5176\u80fd\u591f\u63d0\u4f9b\u4e00\u4e2a\u5b8c\u6574\u7684Web\u5e94\u7528\u8fd0\u884c\u5e73\u53f0&#xff0c;\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u5feb\u901f\u5904\u7406HTTP\u8bf7\u6c42&#xff0c;\u8fd8\u80fd\u9ad8\u6548\u6267\u884cPHP\u811a\u672c\u5e76\u5904\u7406\u6570\u636e\u5e93\u4ea4\u4e92\u3002\u8fd9\u4e00\u7ec4\u5408\u7684\u4f18\u52bf\u5728\u4e8e&#xff1a; <\/p>\n<ul>\n<li>  \u9ad8\u6548\u6027  &#xff1a;Nginx\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\u548cWeb\u670d\u52a1\u5668&#xff0c;\u4ee5\u5f02\u6b65\u975e\u963b\u585e\u7684\u4e8b\u4ef6\u9a71\u52a8\u6a21\u578b\u5904\u7406\u9759\u6001\u6587\u4ef6&#xff0c;\u51cf\u8f7b\u4e86PHP\u5904\u7406\u9759\u6001\u5185\u5bb9\u7684\u538b\u529b\u3002 <\/li>\n<li>  \u7a33\u5b9a\u6027  &#xff1a;Nginx\u548cPHP-FPM\u7684\u7ed3\u5408\u4fdd\u8bc1\u4e86\u5927\u91cf\u5e76\u53d1\u8fde\u63a5\u4e0b\u8d44\u6e90\u7684\u9ad8\u6548\u5206\u914d&#xff0c;\u907f\u514d\u4e86\u4f20\u7edfPHP\u6a21\u5f0f\u4e0b\u7684\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\u3002 <\/li>\n<li>  \u53ef\u914d\u7f6e\u6027  &#xff1a;\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\u6587\u4ef6\u548c\u6a21\u5757\u5316\u7684\u6269\u5c55&#xff0c;WNMP\u73af\u5883\u53ef\u4ee5\u5feb\u901f\u9002\u5e94\u4e0d\u540c\u7684\u5f00\u53d1\u9700\u6c42&#xff0c;\u4ece\u800c\u7f29\u77ed\u5f00\u53d1\u5468\u671f\u3002 <\/li>\n<\/ul>\n<h3> WNMP\u5728Web\u5f00\u53d1\u4e2d\u7684\u4f5c\u7528 <\/h3>\n<p> WNMP\u73af\u5883\u5728Web\u5f00\u53d1\u4e2d\u626e\u6f14\u7740\u6838\u5fc3\u89d2\u8272\u3002\u5b83\u4e0d\u4ec5\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u5f00\u53d1\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72Web\u5e94\u7528\u7684\u7b80\u4fbf\u5e73\u53f0&#xff0c;\u8fd8\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u914d\u7f6e\u6765\u6ee1\u8db3\u4e0d\u540c\u89c4\u6a21\u5e94\u7528\u7684\u6027\u80fd\u9700\u6c42\u3002WNMP\u73af\u5883\u7684\u642d\u5efa\u662fWeb\u5f00\u53d1\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u6b65&#xff0c;\u5b83\u4e3a\u5b9e\u73b0\u5feb\u901f\u8fed\u4ee3\u3001\u9ad8\u8d28\u91cf\u90e8\u7f72\u63d0\u4f9b\u4e86\u575a\u5b9e\u7684\u57fa\u7840\u3002\u5728\u672c\u7ae0\u4e2d&#xff0c;\u6211\u4eec\u5c06\u6df1\u5165\u4e86\u89e3WNMP\u73af\u5883\u7684\u642d\u5efa\u8fc7\u7a0b&#xff0c;\u4ee5\u53ca\u5728Web\u5f00\u53d1\u4e2d\u5982\u4f55\u53d1\u6325\u5176\u6700\u5927\u4f5c\u7528\u3002 <\/p>\n<h2> 2. Nginx\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e <\/h2>\n<p> Nginx\u662f\u4e00\u6b3e\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668&#xff0c;\u540c\u65f6\u4e5f\u662f\u4e00\u6b3eIMAP\/POP3\/SMTP\u670d\u52a1\u5668\u3002\u5728\u73b0\u4ee3Web\u5f00\u53d1\u4e2d&#xff0c;Nginx\u56e0\u5176\u9ad8\u5e76\u53d1\u3001\u4f4e\u5185\u5b58\u6d88\u8017\u548c\u7b80\u5355\u7684\u914d\u7f6e\u6587\u4ef6\u800c\u5e7f\u53d7\u6b22\u8fce\u3002\u5728\u672c\u7ae0\u4e2d&#xff0c;\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8Nginx\u7684\u5b89\u88c5\u3001\u914d\u7f6e\u53ca\u5176\u5728Web\u5f00\u53d1\u4e2d\u7684\u5e94\u7528\u3002 <\/p>\n<h3> 2.1 Nginx\u7684\u57fa\u672c\u4ecb\u7ecd <\/h3>\n<h4> 2.1.1 Nginx\u7684\u4f5c\u7528\u4e0e\u4f18\u52bf <\/h4>\n<p> Nginx\u7684\u4f5c\u7528\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762&#xff1a; <\/p>\n<ul>\n<li> \u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668&#xff0c;\u5c24\u5176\u5728\u5904\u7406\u9759\u6001\u6587\u4ef6\u65f6\u8868\u73b0\u7a81\u51fa\u3002 <\/li>\n<li> \u53cd\u5411\u4ee3\u7406&#xff0c;\u7528\u4e8e\u8d1f\u8f7d\u5747\u8861\u548c\u7f13\u5b58\u9759\u6001\u5185\u5bb9\u3002 <\/li>\n<li> \u652f\u6301HTTP\u3001HTTPS\u3001SMTP\u3001POP3\u3001IMAP\u7b49\u534f\u8bae\u3002 <\/li>\n<\/ul>\n<p> Nginx\u7684\u4f18\u52bf\u5305\u62ec&#xff1a; <\/p>\n<ul>\n<li>  \u9ad8\u6027\u80fd  &#xff1a;Nginx\u91c7\u7528\u5f02\u6b65\u975e\u963b\u585e\u4e8b\u4ef6\u9a71\u52a8\u67b6\u6784&#xff0c;\u80fd\u591f\u5904\u7406\u5927\u91cf\u5e76\u53d1\u8fde\u63a5\u3002 <\/li>\n<li>  \u4f4e\u8d44\u6e90\u6d88\u8017  &#xff1a;Nginx\u5728\u5904\u7406\u5927\u91cf\u5e76\u53d1\u8fde\u63a5\u65f6&#xff0c;\u5185\u5b58\u548cCPU\u5360\u7528\u7387\u76f8\u5bf9\u8f83\u4f4e\u3002 <\/li>\n<li>  \u53ef\u6269\u5c55\u6027  &#xff1a;Nginx\u6a21\u5757\u5316\u8bbe\u8ba1&#xff0c;\u6613\u4e8e\u6269\u5c55&#xff0c;\u652f\u6301\u591a\u79cd\u63d2\u4ef6\u3002 <\/li>\n<li>  \u9ad8\u53ef\u9760\u6027  &#xff1a;\u5177\u6709\u70ed\u90e8\u7f72\u80fd\u529b&#xff0c;\u53ef\u4ee5\u65e0\u7f1d\u91cd\u542f\u548c\u5347\u7ea7\u3002 <\/li>\n<\/ul>\n<h4> 2.1.2 Nginx\u4e0eApache\u7684\u5bf9\u6bd4 <\/h4>\n<p> \u5728Web\u670d\u52a1\u5668\u9886\u57df&#xff0c;Apache\u4e00\u76f4\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u73a9\u5bb6\u3002\u5bf9\u6bd4Nginx&#xff0c;Apache\u7684\u4e3b\u8981\u4f18\u52bf\u5728\u4e8e\u6210\u719f\u7a33\u5b9a\u3001\u6a21\u5757\u4e30\u5bcc\u3002\u7136\u800c&#xff0c;Nginx\u7684\u9ad8\u6027\u80fd\u548c\u4f4e\u8d44\u6e90\u5360\u7528\u4f7f\u5176\u5728\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b\u66f4\u5177\u5438\u5f15\u529b\u3002 <\/p>\n<p> Nginx\u4e0eApache\u7684\u4e3b\u8981\u5bf9\u6bd4\u70b9\u5982\u4e0b&#xff1a; <\/p>\n<ul>\n<li>  \u6027\u80fd  &#xff1a;Nginx\u5728\u5904\u7406\u9759\u6001\u5185\u5bb9\u548c\u9ad8\u5e76\u53d1\u8fde\u63a5\u65f6\u6027\u80fd\u66f4\u9ad8\u3002 <\/li>\n<li>  \u8d44\u6e90\u5360\u7528  &#xff1a;Nginx\u5360\u7528\u66f4\u5c11\u7684\u7cfb\u7edf\u8d44\u6e90\u3002 <\/li>\n<li>  \u914d\u7f6e  &#xff1a;Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u76f8\u5bf9\u7b80\u5355\u76f4\u89c2&#xff0c;\u800cApache\u7684\u914d\u7f6e\u5219\u66f4\u4e3a\u590d\u6742\u3002 <\/li>\n<li>  \u6a21\u5757\u5316  &#xff1a;Apache\u6a21\u5757\u5316\u7a0b\u5ea6\u9ad8&#xff0c;\u4f46Nginx\u901a\u8fc7\u7b2c\u4e09\u65b9\u6a21\u5757\u4e5f\u80fd\u5b9e\u73b0\u7c7b\u4f3c\u529f\u80fd\u3002 <\/li>\n<\/ul>\n<h3> 2.2 Nginx\u7684\u5b89\u88c5\u8fc7\u7a0b <\/h3>\n<h4> 2.2.1 \u7cfb\u7edf\u73af\u5883\u68c0\u67e5\u4e0e\u4f9d\u8d56\u5b89\u88c5 <\/h4>\n<p> \u5728\u5f00\u59cb\u5b89\u88c5Nginx\u4e4b\u524d&#xff0c;\u9996\u5148\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u73af\u5883\u6ee1\u8db3Nginx\u7684\u8fd0\u884c\u8981\u6c42\u3002\u8fd9\u901a\u5e38\u5305\u62ec\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u3001\u7f51\u7edc\u914d\u7f6e\u4ee5\u53ca\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u5305\u3002 <\/p>\n<ul>\n<li>  \u64cd\u4f5c\u7cfb\u7edf  &#xff1a;\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u90fd\u652f\u6301Nginx&#xff0c;\u5982Ubuntu\u3001CentOS\u7b49\u3002 <\/li>\n<li>  \u4f9d\u8d56\u5305  &#xff1a;\u7f16\u8bd1\u5b89\u88c5Nginx\u9700\u8981GCC\u7f16\u8bd1\u5668\u3001PCRE\u5e93\u3001zlib\u538b\u7f29\u5e93\u7b49\u3002 <\/li>\n<\/ul>\n<p> \u5b89\u88c5\u4f9d\u8d56\u7684\u547d\u4ee4\u793a\u4f8b\u5982\u4e0b&#xff08;\u4ee5Ubuntu\u4e3a\u4f8b&#xff09;&#xff1a; <\/p>\n<p>sudo apt-get update<br \/>\nsudo apt-get install build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev<\/p>\n<h4> 2.2.2 Nginx\u7684\u4e0b\u8f7d\u4e0e\u89e3\u538b <\/h4>\n<p> Nginx\u63d0\u4f9b\u7a33\u5b9a\u7248\u548c\u5f00\u53d1\u7248\u4f9b\u7528\u6237\u4e0b\u8f7d\u3002\u5efa\u8bae\u751f\u4ea7\u73af\u5883\u4f7f\u7528\u7a33\u5b9a\u7248&#xff0c;\u5f00\u53d1\u73af\u5883\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u5f00\u53d1\u7248\u4ee5\u4fbf\u4f7f\u7528\u6700\u65b0\u529f\u80fd\u3002 <\/p>\n<p> \u4e0b\u8f7d\u5730\u5740\u4e3a&#xff1a;http:\/\/nginx.org\/en\/download.html <\/p>\n<p> \u4e0b\u8f7dNginx\u7684\u547d\u4ee4\u5982\u4e0b&#xff1a; <\/p>\n<p>wget http:\/\/nginx.org\/download\/nginx-1.20.0.tar.gz<\/p>\n<p> \u89e3\u538b\u4e0b\u8f7d\u7684\u6587\u4ef6&#xff1a; <\/p>\n<p>tar -zxvf nginx-1.20.0.tar.gz<\/p>\n<h4> 2.2.3 Nginx\u7684\u7f16\u8bd1\u5b89\u88c5\u4e0e\u9a8c\u8bc1 <\/h4>\n<p> \u7f16\u8bd1\u5b89\u88c5Nginx\u9700\u8981\u4f7f\u7528  .\/configure  \u547d\u4ee4\u6765\u914d\u7f6e\u5b89\u88c5\u9009\u9879\u3002\u7f16\u8bd1\u5b89\u88c5\u7684\u5178\u578b\u6b65\u9aa4\u5982\u4e0b&#xff1a; <\/p>\n<p>cd nginx-1.20.0<br \/>\n.\/configure<br \/>\nmake<br \/>\nsudo make install<\/p>\n<p> \u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5Nginx\u7248\u672c\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f&#xff1a; <\/p>\n<p>nginx -v<\/p>\n<p> \u8fd9\u5c06\u663e\u793a\u5df2\u5b89\u88c5\u7684Nginx\u7248\u672c\u4fe1\u606f&#xff0c;\u5982\u201cnginx version: nginx\/1.20.0\u201d\u3002 <\/p>\n<h3> 2.3 Nginx\u7684\u914d\u7f6e\u8be6\u89e3 <\/h3>\n<h4> 2.3.1 Nginx\u914d\u7f6e\u6587\u4ef6\u7ed3\u6784 <\/h4>\n<p> Nginx\u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e  \/etc\/nginx\/nginx.conf  &#xff0c;\u4ee5\u53ca\u5404\u4e2a\u7ad9\u70b9\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u4e8e  \/etc\/nginx\/sites-available\/  \u76ee\u5f55\u4e0b\u3002 <\/p>\n<p> \u914d\u7f6e\u6587\u4ef6\u7684\u57fa\u672c\u7ed3\u6784\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206&#xff1a; <\/p>\n<ul>\n<li>  main  \u5757&#xff1a;\u5305\u542b\u5f71\u54cd\u6574\u4e2aNginx\u670d\u52a1\u5668\u7684\u5168\u5c40\u914d\u7f6e\u6307\u4ee4\u3002 <\/li>\n<li>  events  \u5757&#xff1a;\u914d\u7f6eNginx\u5982\u4f55\u5904\u7406\u8fde\u63a5\u3002 <\/li>\n<li>  http  \u5757&#xff1a;\u914d\u7f6eWeb\u670d\u52a1\u5668\u7684\u4e3b\u8981\u6307\u4ee4&#xff0c;\u53ef\u4ee5\u5b9a\u4e49\u591a\u4e2a  server  \u5757\u3002 <\/li>\n<li>  server  \u5757&#xff1a;\u7528\u4e8e\u914d\u7f6e\u4e00\u4e2a\u865a\u62df\u4e3b\u673a\u3002 <\/li>\n<li>  location  \u5757&#xff1a;\u7528\u4e8e\u914d\u7f6e\u7279\u5b9a\u8def\u5f84\u4e0b\u7684\u8bf7\u6c42\u5904\u7406\u65b9\u5f0f\u3002 <\/li>\n<\/ul>\n<h4> 2.3.2 \u5e38\u7528\u914d\u7f6e\u9879\u89e3\u6790 <\/h4>\n<p> \u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684Nginx\u914d\u7f6e\u9879&#xff1a; <\/p>\n<ul>\n<li>  user  : \u8bbe\u7f6e\u8fd0\u884cNginx\u7684\u5de5\u4f5c\u7528\u6237\u3002 <\/li>\n<li>  worker_processes  : \u8bbe\u7f6e\u5de5\u4f5c\u8fdb\u7a0b\u6570&#xff0c;\u901a\u5e38\u8bbe\u7f6e\u4e3aCPU\u6838\u5fc3\u6570\u3002 <\/li>\n<li>  error_log  : \u5b9a\u4e49\u9519\u8bef\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u3002 <\/li>\n<li>  worker_connections  : \u8bbe\u7f6e\u6bcf\u4e2aworker\u8fdb\u7a0b\u7684\u6700\u5927\u8fde\u63a5\u6570\u3002 <\/li>\n<li>  keepalive_timeout  : \u8bbe\u7f6e\u957f\u8fde\u63a5\u7684\u8d85\u65f6\u65f6\u95f4\u3002 <\/li>\n<\/ul>\n<p> \u793a\u4f8b\u914d\u7f6e&#xff1a; <\/p>\n<p>http {<br \/>\n    include       mime.types;<br \/>\n    default_type  application\/octet-stream;<br \/>\n    sendfile        on;<br \/>\n    keepalive_timeout  65;<br \/>\n    server {<br \/>\n        listen       80;<br \/>\n        server_name  localhost;<br \/>\n        location \/ {<br \/>\n            root   html;<br \/>\n            index  index.html index.htm;<br \/>\n        }<br \/>\n        error_page   500 502 503 504  \/50x.html;<br \/>\n        location &#061; \/50x.html {<br \/>\n            root   html;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<h4> 2.3.3 \u670d\u52a1\u5668\u5b9e\u4f8b\u914d\u7f6e\u4e0e\u6d4b\u8bd5 <\/h4>\n<p> \u914d\u7f6eNginx\u4e3a\u4e00\u4e2a\u7b80\u5355\u7684Web\u670d\u52a1\u5668\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e00\u4e2a  server  \u5757\u6765\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684\u914d\u7f6e\u5b9e\u4f8b&#xff1a; <\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name example.com;<\/p>\n<p>    location \/ {<br \/>\n        root \/var\/www\/example.com\/public;<br \/>\n        index index.php index.html index.htm;<br \/>\n    }<\/p>\n<p>    location ~ \\\\.php$ {<br \/>\n        fastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock;<br \/>\n        fastcgi_index index.php;<br \/>\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n        include fastcgi_params;<br \/>\n    }<br \/>\n}<\/p>\n<p> \u8be5\u914d\u7f6e\u76d1\u542c80\u7aef\u53e3&#xff0c;\u5c06\u8bf7\u6c42\u8f6c\u53d1\u5230PHP\u5904\u7406\u5668&#xff0c;\u5e76\u5904\u7406  .php  \u6587\u4ef6\u3002\u4e3a\u4e86\u6d4b\u8bd5\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6b63\u786e&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4&#xff1a; <\/p>\n<p>nginx -t<\/p>\n<p> \u5982\u679c\u914d\u7f6e\u6587\u4ef6\u8bed\u6cd5\u6b63\u786e&#xff0c;\u5c06\u663e\u793a\u201csyntax is ok\u201d\u548c\u201ctest is successful\u201d\u6d88\u606f\u3002\u4e4b\u540e&#xff0c;\u53ef\u4ee5\u91cd\u542fNginx\u670d\u52a1\u6765\u5e94\u7528\u66f4\u6539&#xff1a; <\/p>\n<p>sudo systemctl restart nginx<\/p>\n<p> \u4ee5\u4e0a\u6b65\u9aa4\u5b8c\u6210\u4e86Nginx\u7684\u57fa\u672c\u5b89\u88c5\u548c\u914d\u7f6e\u3002\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u5c06\u7ee7\u7eed\u63a2\u7d22MySQL\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e\u8fc7\u7a0b&#xff0c;\u5b83\u662f\u6784\u5efaWNMP\u73af\u5883\u7684\u53e6\u4e00\u4e2a\u5173\u952e\u7ec4\u4ef6\u3002 <\/p>\n<h2> 3. MySQL\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e <\/h2>\n<h3> 3.1 MySQL\u6982\u8ff0 <\/h3>\n<h4> 3.1.1 MySQL\u7684\u529f\u80fd\u7279\u70b9 <\/h4>\n<p> MySQL\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf&#xff0c;\u5176\u6838\u5fc3\u529f\u80fd\u5305\u62ec\u6570\u636e\u5b58\u50a8\u3001\u67e5\u8be2\u5904\u7406\u548c\u4e8b\u52a1\u7ba1\u7406\u3002\u5b83\u7684\u5b58\u50a8\u5f15\u64ce\u67b6\u6784\u5141\u8bb8\u5f00\u53d1\u8005\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u5b58\u50a8\u673a\u5236\u3002MySQL\u4ee5\u5176\u9ad8\u5e76\u53d1\u5904\u7406\u80fd\u529b\u548c\u7a33\u5b9a\u6027\u5728Web\u5f00\u53d1\u4e2d\u88ab\u5e7f\u6cdb\u91c7\u7528\u3002 <\/p>\n<h4> 3.1.2 MySQL\u5728Web\u5f00\u53d1\u4e2d\u7684\u89d2\u8272 <\/h4>\n<p> \u5728Web\u5f00\u53d1\u4e2d&#xff0c;MySQL\u901a\u5e38\u8d1f\u8d23\u5904\u7406\u540e\u7aef\u6570\u636e\u5b58\u50a8\u7684\u4efb\u52a1\u3002\u5b83\u4e0e\u524d\u7aef\u5e94\u7528\u7a0b\u5e8f\u901a\u8fc7SQL\u8bed\u53e5\u8fdb\u884c\u4ea4\u4e92&#xff0c;\u5b58\u50a8\u7528\u6237\u6570\u636e\u3001\u4f1a\u8bdd\u72b6\u6001\u548c\u5404\u79cd\u4e1a\u52a1\u903b\u8f91\u6570\u636e\u3002Web\u5f00\u53d1\u8005\u7ecf\u5e38\u5229\u7528MySQL\u5f3a\u5927\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7279\u6027&#xff0c;\u4f8b\u5982\u6570\u636e\u5b8c\u6574\u6027\u3001\u4e8b\u52a1\u5904\u7406\u4ee5\u53caACID\u5c5e\u6027\u6765\u6784\u5efa\u590d\u6742\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002 <\/p>\n<h3> 3.2 MySQL\u7684\u5b89\u88c5\u6b65\u9aa4 <\/h3>\n<h4> 3.2.1 \u73af\u5883\u68c0\u67e5\u4e0e\u4f9d\u8d56\u51c6\u5907 <\/h4>\n<p> \u5728\u5b89\u88c5MySQL\u4e4b\u524d&#xff0c;\u9700\u8981\u68c0\u67e5\u7cfb\u7edf\u73af\u5883\u662f\u5426\u6ee1\u8db3MySQL\u7684\u8fd0\u884c\u8981\u6c42\u3002\u4f8b\u5982&#xff0c;\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u7684MySQL\u5305\u4f9d\u8d56\u4e8elibaio\u5e93\u548ccurl\u5de5\u5177\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u3002 <\/p>\n<p># \u5bf9\u4e8eDebian\/Ubuntu\u7cfb\u7edf<br \/>\nsudo apt-get update<br \/>\nsudo apt-get install libaio1 curl<\/p>\n<p># \u5bf9\u4e8eRed Hat\/CentOS\u7cfb\u7edf<br \/>\nsudo yum update<br \/>\nsudo yum install libaio curl<\/p>\n<p> \u5b89\u88c5\u5b8c\u4f9d\u8d56\u540e&#xff0c;\u53ef\u4ee5\u7ee7\u7eed\u5b89\u88c5MySQL\u3002 <\/p>\n<h4> 3.2.2 MySQL\u7684\u4e0b\u8f7d\u4e0e\u5b89\u88c5 <\/h4>\n<p> \u7528\u6237\u53ef\u4ee5\u901a\u8fc7MySQL\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5b89\u88c5\u5305\u6216\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5MySQL\u7684\u547d\u4ee4\u793a\u4f8b&#xff1a; <\/p>\n<p># \u5bf9\u4e8eDebian\/Ubuntu\u7cfb\u7edf<br \/>\nsudo apt-get install mysql-server<\/p>\n<p># \u5bf9\u4e8eRed Hat\/CentOS\u7cfb\u7edf<br \/>\nsudo yum install mysql-server<\/p>\n<p> \u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u8fd8\u4f1a\u8981\u6c42\u8bbe\u7f6eroot\u5bc6\u7801\u4ee5\u53ca\u5176\u4ed6\u5b89\u5168\u8bbe\u7f6e\u3002\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u670d\u52a1\u547d\u4ee4\u542f\u52a8MySQL\u670d\u52a1\u3002 <\/p>\n<h4> 3.2.3 MySQL\u670d\u52a1\u7684\u542f\u52a8\u4e0e\u9a8c\u8bc1 <\/h4>\n<p> \u4e3a\u4e86\u786e\u4fddMySQL\u670d\u52a1\u6b63\u5e38\u8fd0\u884c&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8MySQL\u670d\u52a1&#xff0c;\u5e76\u68c0\u67e5\u670d\u52a1\u72b6\u6001\u3002 <\/p>\n<p># \u542f\u52a8MySQL\u670d\u52a1<br \/>\nsudo systemctl start mysqld<\/p>\n<p># \u68c0\u67e5MySQL\u670d\u52a1\u72b6\u6001<br \/>\nsudo systemctl status mysqld<\/p>\n<p> \u5982\u679c\u670d\u52a1\u72b6\u6001\u663e\u793a\u4e3aactive(running)&#xff0c;\u5219\u8868\u793aMySQL\u670d\u52a1\u5df2\u6b63\u5e38\u542f\u52a8\u3002 <\/p>\n<h3> 3.3 MySQL\u7684\u914d\u7f6e\u4e0e\u4f18\u5316 <\/h3>\n<h4> 3.3.1 \u914d\u7f6e\u6587\u4ef6\u7684\u7f16\u8f91 <\/h4>\n<p> MySQL\u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e  \/etc\/mysql\/my.cnf  \u6216\u8005  \/etc\/mysql\/mysql.conf.d\/  \u76ee\u5f55\u4e0b\u3002\u914d\u7f6e\u6587\u4ef6\u4e2d\u53ef\u4ee5\u8bbe\u7f6e\u5404\u79cd\u53c2\u6570&#xff0c;\u4f8b\u5982\u5185\u5b58\u4f7f\u7528\u3001\u8fde\u63a5\u6570\u9650\u5236\u3001\u67e5\u8be2\u7f13\u5b58\u5927\u5c0f\u7b49\u3002 <\/p>\n<p># \u7f16\u8f91MySQL\u914d\u7f6e\u6587\u4ef6<br \/>\nsudo nano \/etc\/mysql\/my.cnf<\/p>\n<p> \u4f8b\u5982&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e  key_buffer_size  \u4e3a\u7cfb\u7edf\u53ef\u7528\u5185\u5b58\u768425%&#xff0c;\u4f18\u5316\u6570\u636e\u7d22\u5f15\u7684\u4f7f\u7528\u3002 <\/p>\n<h4> 3.3.2 \u6570\u636e\u5e93\u6027\u80fd\u4f18\u5316\u57fa\u7840 <\/h4>\n<p> MySQL\u6570\u636e\u5e93\u7684\u6027\u80fd\u4f18\u5316\u662f\u4e00\u4e2a\u590d\u6742\u7684\u8fc7\u7a0b&#xff0c;\u6db5\u76d6\u591a\u4e2a\u65b9\u9762\u3002\u5e38\u89c1\u7684\u4f18\u5316\u63aa\u65bd\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e&#xff1a; <\/p>\n<ul>\n<li> \u7d22\u5f15\u4f18\u5316&#xff1a;\u5408\u7406\u4f7f\u7528\u7d22\u5f15\u80fd\u591f\u52a0\u901f\u6570\u636e\u68c0\u7d22\u3002 <\/li>\n<li> \u67e5\u8be2\u4f18\u5316&#xff1a;\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8868\u8fde\u63a5\u548c\u5b50\u67e5\u8be2&#xff0c;\u5408\u7406\u4f7f\u7528\u4e8b\u52a1\u3002 <\/li>\n<li> \u786c\u4ef6\u5347\u7ea7&#xff1a;\u589e\u52a0\u5185\u5b58\u5bb9\u91cf&#xff0c;\u4f7f\u7528\u66f4\u5feb\u7684\u78c1\u76d8\u5982SSD\u3002 <\/li>\n<li> MySQL\u914d\u7f6e\u8c03\u6574&#xff1a;\u6839\u636e\u5b9e\u9645\u8d1f\u8f7d\u8c03\u6574InnoDB\u7f13\u51b2\u6c60\u5927\u5c0f\u7b49\u53c2\u6570\u3002 <\/li>\n<\/ul>\n<h4> 3.3.3 \u5e38\u89c1\u95ee\u9898\u5904\u7406\u4e0e\u5b89\u5168\u6027\u8bbe\u7f6e <\/h4>\n<p> \u5728\u65e5\u5e38\u7ef4\u62a4MySQL\u670d\u52a1\u5668\u65f6&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u95ee\u9898&#xff0c;\u5982\u6162\u67e5\u8be2\u3001\u8fde\u63a5\u6570\u8fc7\u591a\u3001\u8868\u9501\u7b49\u3002\u9664\u4e86\u5e38\u89c4\u7684\u4f18\u5316\u63aa\u65bd\u5916&#xff0c;\u8fd8\u9700\u8981\u8fdb\u884c\u5b89\u5168\u6027\u8bbe\u7f6e&#xff0c;\u6bd4\u5982\u7981\u6b62root\u8fdc\u7a0b\u767b\u5f55\u3001\u8bbe\u7f6e\u5bc6\u7801\u7b56\u7565\u4ee5\u53ca\u5b9a\u671f\u5907\u4efd\u6570\u636e\u5e93\u3002 <\/p>\n<p>&#8212; \u4f8b\u5982&#xff0c;\u7981\u6b62root\u7528\u6237\u8fdc\u7a0b\u767b\u5f55<br \/>\nUPDATE mysql.user SET Host &#061; &#039;localhost&#039; WHERE User &#061; &#039;root&#039;;<\/p>\n<p> \u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u53ef\u4ee5\u5b8c\u6210MySQL\u7684\u5b89\u88c5\u548c\u57fa\u672c\u914d\u7f6e&#xff0c;\u4e3aWNMP\u73af\u5883\u7684\u642d\u5efa\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u63a5\u4e0b\u6765\u7ae0\u8282\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u914d\u7f6ePHP\u4ee5\u53caNginx\u4e0ePHP\u7684\u96c6\u6210\u914d\u7f6e\u3002 <\/p>\n<h2> 4. PHP\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e <\/h2>\n<h3> 4.1 PHP\u7684\u7b80\u4ecb <\/h3>\n<h4> 4.1.1 PHP\u7684\u57fa\u672c\u529f\u80fd\u4e0e\u5e94\u7528\u9886\u57df <\/h4>\n<p> PHP\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u5f00\u6e90\u670d\u52a1\u5668\u7aef\u811a\u672c\u8bed\u8a00&#xff0c;\u7279\u522b\u9002\u7528\u4e8eWeb\u5f00\u53d1&#xff0c;\u53ef\u4ee5\u5d4c\u5165HTML\u4e2d\u4f7f\u7528\u3002PHP\u7684\u4e3b\u8981\u529f\u80fd\u5305\u62ec\u521b\u5efa\u52a8\u6001\u7f51\u9875\u5185\u5bb9\u3001\u5904\u7406\u8868\u5355\u6570\u636e\u3001\u521b\u5efa\u3001\u6253\u5f00\u3001\u8bfb\u53d6\u3001\u5199\u5165\u548c\u5173\u95ed\u670d\u52a1\u5668\u4e0a\u7684\u6587\u4ef6\u7b49\u3002\u5176\u5e94\u7528\u9886\u57df\u975e\u5e38\u5e7f\u6cdb&#xff0c;\u4ece\u7b80\u5355\u7684\u4e2a\u4eba\u535a\u5ba2\u5230\u590d\u6742\u7684\u7535\u5b50\u5546\u52a1\u5e73\u53f0&#xff0c;\u5982WordPress, Drupal, \u548cMagento\u7b49\u77e5\u540d\u7cfb\u7edf\u90fd\u662f\u57fa\u4e8ePHP\u5f00\u53d1\u7684\u3002PHP\u7684\u6613\u7528\u6027\u548c\u7075\u6d3b\u6027\u4f7f\u5f97\u5b83\u6210\u4e3a\u521d\u5b66\u8005\u548c\u4e13\u4e1a\u4eba\u58eb\u7684\u9996\u9009\u670d\u52a1\u5668\u7aef\u8bed\u8a00\u4e4b\u4e00\u3002 <\/p>\n<h4> 4.1.2 PHP\u4e0e\u5176\u4ed6\u670d\u52a1\u5668\u8bed\u8a00\u7684\u5bf9\u6bd4 <\/h4>\n<p> \u5c3d\u7ba1\u5176\u4ed6\u670d\u52a1\u5668\u7aef\u8bed\u8a00\u5982Python, Ruby\u548cNode.js\u4e5f\u5728\u73b0\u4ee3Web\u5f00\u53d1\u4e2d\u5360\u6709\u4e00\u5e2d\u4e4b\u5730&#xff0c;\u4f46PHP\u4ee5\u5176\u5feb\u901f\u7684\u5b66\u4e60\u66f2\u7ebf\u548c\u6210\u719f\u7684\u751f\u6001\u7cfb\u7edf\u5728Web\u5f00\u53d1\u4e2d\u4ecd\u5360\u6709\u91cd\u8981\u5730\u4f4d\u3002\u4e0ePython\u76f8\u6bd4&#xff0c;PHP\u901a\u5e38\u5728Web\u5f00\u53d1\u4e2d\u7684\u6267\u884c\u901f\u5ea6\u66f4\u5feb&#xff0c;\u4f46Python\u5728\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u7b49\u5176\u4ed6\u9886\u57df\u53ef\u80fd\u66f4\u6709\u4f18\u52bf\u3002Ruby\u548cNode.js\u4e5f\u63d0\u4f9b\u4e86\u9ad8\u6027\u80fd\u7684Web\u5e94\u7528\u5e73\u53f0&#xff0c;\u4f46\u5b83\u4eec\u7684\u793e\u533a\u548c\u5e93\u652f\u6301\u6ca1\u6709PHP\u5e7f\u6cdb\u3002\u603b\u7684\u6765\u8bf4&#xff0c;\u9009\u62e9\u54ea\u79cd\u8bed\u8a00\u4e3b\u8981\u53d6\u51b3\u4e8e\u9879\u76ee\u9700\u6c42\u548c\u5f00\u53d1\u8005\u7684\u4e2a\u4eba\u504f\u597d\u3002 <\/p>\n<h3> 4.2 PHP\u7684\u5b89\u88c5\u6d41\u7a0b <\/h3>\n<h4> 4.2.1 PHP\u73af\u5883\u9700\u6c42\u5206\u6790 <\/h4>\n<p> \u5b89\u88c5PHP\u4e4b\u524d&#xff0c;\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u6ee1\u8db3\u4e00\u4e9b\u57fa\u7840\u7684\u73af\u5883\u9700\u6c42\u3002\u5927\u591a\u6570\u73b0\u4ee3Linux\u53d1\u884c\u7248\u90fd\u4f1a\u9884\u88c5\u4e00\u4e9bPHP\u4f9d\u8d56\u5305&#xff0c;\u4f8b\u5982GCC\u7f16\u8bd1\u5668\u3001libxml2\u3001libjpeg\u3001libpng\u7b49\u3002\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u7f3a\u5c11\u8fd9\u4e9b\u4f9d\u8d56\u9879&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u5b83\u4eec\u3002\u4f8b\u5982&#xff0c;\u5728\u57fa\u4e8eDebian\u7684\u7cfb\u7edf\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879&#xff1a; <\/p>\n<p>sudo apt update<br \/>\nsudo apt install build-essential libxml2-dev libjpeg-dev libpng-dev<\/p>\n<h4> 4.2.2 PHP\u7684\u4e0b\u8f7d\u4e0e\u7f16\u8bd1\u5b89\u88c5 <\/h4>\n<p> \u63a5\u4e0b\u6765&#xff0c;\u53ef\u4ee5\u4ecePHP\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248PHP\u6e90\u4ee3\u7801&#xff0c;\u7136\u540e\u7f16\u8bd1\u5b89\u88c5\u3002\u4ee5\u4e0b\u662f\u4e0b\u8f7d\u548c\u7f16\u8bd1PHP\u7684\u4e00\u822c\u6b65\u9aa4&#xff1a; <\/p>\n<p>wget http:\/\/www.php.net\/distributions\/php-7.4.10.tar.gz<br \/>\ntar xvf php-7.4.10.tar.gz<br \/>\ncd php-7.4.10<br \/>\n.\/configure &#8211;prefix&#061;\/usr\/local\/php7 &#8211;with-config-file-path&#061;\/usr\/local\/php7\/etc &#8211;enable-mbstring &#8211;enable-sockets &#8211;enable-zip &#8211;enable-inline-optimization &#8211;with-mysqli &#8211;with-pdo-mysql<br \/>\nmake<br \/>\nsudo make install<\/p>\n<p> \u4ee5\u4e0a\u547d\u4ee4\u9996\u5148\u4e0b\u8f7d\u5e76\u89e3\u538bPHP\u6e90\u4ee3\u7801&#xff0c;\u7136\u540e\u8fdb\u5165\u89e3\u538b\u76ee\u5f55&#xff0c;\u8fd0\u884c  .\/configure  \u547d\u4ee4\u51c6\u5907\u7f16\u8bd1\u73af\u5883&#xff0c;\u6307\u5b9a\u5b89\u88c5\u8def\u5f84\u3001\u5f00\u542f\u5fc5\u8981\u7684\u6269\u5c55\u3001\u4ee5\u53ca\u9644\u52a0\u7684\u914d\u7f6e\u9009\u9879\u3002\u4e4b\u540e\u901a\u8fc7  make  \u547d\u4ee4\u7f16\u8bd1\u6e90\u4ee3\u7801&#xff0c;\u6700\u540e\u4f7f\u7528  make install  \u547d\u4ee4\u5b8c\u6210\u5b89\u88c5\u3002 <\/p>\n<h4> 4.2.3 PHP\u7684\u7248\u672c\u9009\u62e9\u4e0e\u6269\u5c55\u914d\u7f6e <\/h4>\n<p> PHP\u63d0\u4f9b\u591a\u4e2a\u7248\u672c&#xff0c;\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u5bf9\u4e8e\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u672a\u6765\u7684\u7ef4\u62a4\u975e\u5e38\u91cd\u8981\u3002\u65b0\u9879\u76ee\u63a8\u8350\u4f7f\u7528\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u4ee5\u83b7\u5f97\u6700\u65b0\u7684\u7279\u6027\u548c\u5b89\u5168\u66f4\u65b0\u3002\u5f53\u7f16\u8bd1\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u66f4\u6539  \/usr\/local\/php7\/etc\/php.ini  \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8bbe\u7f6e\u6765\u8c03\u6574PHP\u884c\u4e3a&#xff0c;\u4f8b\u5982\u8bbe\u7f6e\u65f6\u533a\u3001\u5185\u5b58\u9650\u5236\u3001\u9519\u8bef\u62a5\u544a\u7b49\u3002 <\/p>\n<p> \u6b64\u5916&#xff0c;PHP\u652f\u6301\u4f17\u591a\u6269\u5c55&#xff0c;\u901a\u8fc7\u6269\u5c55\u53ef\u4ee5\u589e\u52a0PHP\u7684\u529f\u80fd\u3002\u5b89\u88c5\u6269\u5c55\u7684\u65b9\u6cd5\u4e00\u822c\u662f\u5148\u4e0b\u8f7d\u5bf9\u5e94\u6e90\u7801\u5e76\u7f16\u8bd1&#xff0c;\u4f8b\u5982\u5b89\u88c5PDO MySQL\u6269\u5c55&#xff1a; <\/p>\n<p>cd \/tmp<br \/>\nwget https:\/\/secure.php.net\/distributions\/pdo_mysql-7.4.10.tgz<br \/>\ntar xvfpdo_mysql-7.4.10.tgz<br \/>\ncd \/pdo_mysql-7.4.10<br \/>\n\/usr\/local\/php7\/bin\/phpize<br \/>\n.\/configure &#8211;with-pdo-mysql&#061;\/usr\/local\/mysql<br \/>\nmake<br \/>\nsudo make install<\/p>\n<p> \u5b89\u88c5\u5b8c\u6269\u5c55\u540e&#xff0c;\u9700\u8981\u5728  php.ini  \u6587\u4ef6\u4e2d\u542f\u7528\u5b83&#xff0c;\u6dfb\u52a0\u4e00\u884c&#xff1a; <\/p>\n<p>extension&#061;pdo_mysql.so<\/p>\n<h3> 4.3 PHP\u7684\u914d\u7f6e\u7ba1\u7406 <\/h3>\n<h4> 4.3.1 php.ini\u6587\u4ef6\u7684\u4fee\u6539\u4e0e\u4f18\u5316 <\/h4>\n<p>  php.ini  \u662fPHP\u7684\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6&#xff0c;\u7528\u4e8e\u63a7\u5236PHP\u7684\u5168\u5c40\u8fd0\u884c\u73af\u5883\u3002\u6b64\u6587\u4ef6\u4e2d\u7684\u914d\u7f6e\u9879\u975e\u5e38\u591a&#xff0c;\u5305\u62ec\u811a\u672c\u6267\u884c\u65f6\u95f4\u9650\u5236\u3001\u5185\u5b58\u4f7f\u7528\u9650\u5236\u3001\u9519\u8bef\u62a5\u544a\u7ea7\u522b\u3001\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u9650\u5236\u7b49\u3002\u4f8b\u5982&#xff0c;\u8c03\u6574\u6267\u884c\u65f6\u95f4\u9650\u5236&#xff1a; <\/p>\n<p>max_execution_time &#061; 60  ; \u8bbe\u7f6e\u811a\u672c\u6700\u5927\u6267\u884c\u65f6\u95f4&#xff08;\u79d2&#xff09;<\/p>\n<p> \u4f18\u5316  php.ini  \u65f6&#xff0c;\u9700\u8981\u6839\u636e\u5b9e\u9645\u5e94\u7528\u573a\u666f\u548c\u670d\u52a1\u5668\u6027\u80fd\u8fdb\u884c\u8c03\u6574\u3002\u5bf9\u4e8e\u8d44\u6e90\u5bc6\u96c6\u578b\u5e94\u7528&#xff0c;\u53ef\u80fd\u9700\u8981\u589e\u52a0\u5185\u5b58\u9650\u5236&#xff0c;\u5e76\u5141\u8bb8\u66f4\u591a\u7684\u6587\u4ef6\u4e0a\u4f20\u5927\u5c0f\u3002 <\/p>\n<h4> 4.3.2 PHP\u6a21\u5757\u7684\u52a8\u6001\u52a0\u8f7d\u4e0e\u7ba1\u7406 <\/h4>\n<p> PHP\u652f\u6301\u52a8\u6001\u52a0\u8f7d\u6a21\u5757&#xff0c;\u8fd9\u610f\u5473\u7740\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5f00\u542f\u6216\u5173\u95ed\u7279\u5b9a\u7684\u529f\u80fd&#xff0c;\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6574\u4e2aPHP\u3002\u6a21\u5757\u901a\u5e38\u901a\u8fc7  extension  \u6307\u4ee4\u5728  php.ini  \u6587\u4ef6\u4e2d\u542f\u7528\u3002PHP\u8fd8\u652f\u6301\u5373\u65f6\u542f\u52a8&#xff08;IMSM&#xff09;\u6269\u5c55&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u6269\u5c55&#xff1a; <\/p>\n<p>php &#8211;ri | grep &#039;Loaded Modules&#039;<\/p>\n<h4> 4.3.3 PHP\u5e38\u89c1\u8fd0\u884c\u65f6\u95ee\u9898\u8bca\u65ad\u4e0e\u89e3\u51b3 <\/h4>\n<p> \u5728PHP\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u95ee\u9898&#xff0c;\u5982\u8bed\u6cd5\u9519\u8bef\u3001\u914d\u7f6e\u9519\u8bef\u6216\u8fd0\u884c\u65f6\u8b66\u544a\u7b49\u3002\u4f7f\u7528  error_reporting  \u548c  display_errors  \u6307\u4ee4\u53ef\u4ee5\u5728  php.ini  \u4e2d\u63a7\u5236\u9519\u8bef\u7684\u663e\u793a&#xff0c;\u5bf9\u4e8e\u5f00\u53d1\u73af\u5883&#xff0c;\u5efa\u8bae\u5f00\u542f\u9519\u8bef\u663e\u793a\u4ee5\u4fbf\u8c03\u8bd5&#xff1a; <\/p>\n<p>error_reporting &#061; E_ALL<br \/>\ndisplay_errors &#061; On<\/p>\n<p> \u4f46\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u5e94\u5173\u95ed\u9519\u8bef\u663e\u793a&#xff0c;\u5e76\u8bb0\u5f55\u9519\u8bef\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d&#xff1a; <\/p>\n<p>display_errors &#061; Off<br \/>\nlog_errors &#061; On<br \/>\nerror_log &#061; \/var\/log\/php_errors.log<\/p>\n<p> \u6b64\u5916&#xff0c;PHP\u7684  xdebug  \u6269\u5c55\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd&#xff0c;\u53ef\u901a\u8fc7Xdebug\u6765\u8ddf\u8e2a\u4ee3\u7801\u6267\u884c\u8fc7\u7a0b\u3001\u5206\u6790\u6027\u80fd\u74f6\u9888\u5e76\u8c03\u8bd5\u3002\u8fd9\u9700\u8981\u5728  php.ini  \u6587\u4ef6\u4e2d\u6dfb\u52a0\u5e76\u914d\u7f6e\u76f8\u5e94\u7684Xdebug\u9009\u9879&#xff0c;\u5e76\u786e\u4fdd\u5b89\u88c5\u4e86Xdebug\u6269\u5c55\u3002 <\/p>\n<p>[xdebug]<br \/>\nzend_extension&#061;&#034;\/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20190902\/xdebug.so&#034;<br \/>\nxdebug.remote_enable&#061;1<br \/>\nxdebug.remote_autostart&#061;1<br \/>\nxdebug.remote_connect_back&#061;1<br \/>\nxdebug.remote_port&#061;9000<\/p>\n<p> \u4ee5\u4e0a\u6b65\u9aa4\u5c55\u793a\u4e86PHP\u73af\u5883\u642d\u5efa\u548c\u914d\u7f6e\u7684\u57fa\u672c\u6d41\u7a0b&#xff0c;\u9488\u5bf9\u7279\u5b9a\u7684\u914d\u7f6e\u9879\u548c\u6269\u5c55&#xff0c;\u8fd8\u9700\u8981\u6839\u636e\u5b9e\u9645\u5f00\u53d1\u73af\u5883\u548c\u9879\u76ee\u9700\u6c42\u8fdb\u884c\u5b9a\u5236\u5316\u8c03\u6574\u3002 <\/p>\n<h2> 5. Nginx\u4e0ePHP\u7684\u96c6\u6210\u914d\u7f6e <\/h2>\n<h3> 5.1 Nginx\u4e0ePHP\u96c6\u6210\u539f\u7406 <\/h3>\n<h4> 5.1.1 FastCGI\u534f\u8bae\u4ecb\u7ecd <\/h4>\n<p> FastCGI\u662f\u4e00\u79cd\u5e38\u7528\u4e8e\u4e92\u8054\u7f51\u670d\u52a1\u5668\u7684\u8bed\u8a00\u65e0\u5173\u7684\u63a5\u53e3\u6807\u51c6&#xff0c;\u5b83\u662f\u4e00\u79cd\u7528\u4e8e\u589e\u5f3aCGI&#xff08;Common Gateway Interface&#xff09;\u529f\u80fd\u7684\u534f\u8bae\u3002\u5b83\u80fd\u591f\u6709\u6548\u964d\u4f4eCGI\u5e26\u6765\u7684\u6027\u80fd\u5f00\u9500&#xff0c;\u56e0\u4e3aFastCGI\u5b88\u62a4\u8fdb\u7a0b\u53ef\u4ee5\u957f\u65f6\u95f4\u8fd0\u884c\u5e76\u5904\u7406\u591a\u4e2a\u8bf7\u6c42&#xff0c;\u800c\u4e0d\u662f\u6bcf\u6b21\u8bf7\u6c42\u90fd\u542f\u52a8\u4e00\u4e2a\u65b0\u8fdb\u7a0b\u3002Web\u670d\u52a1\u5668\u4e0e\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u901a\u8fc7FastCGI\u534f\u8bae\u53ef\u4ee5\u6301\u7eed\u901a\u4fe1&#xff0c;\u8fd9\u79cd\u6301\u7eed\u7684\u901a\u4fe1\u51cf\u5c11\u4e86\u8fdb\u7a0b\u521b\u5efa\u548c\u9500\u6bc1\u7684\u65f6\u95f4\u6d88\u8017&#xff0c;\u4ece\u800c\u63d0\u9ad8\u4e86\u6548\u7387\u3002 <\/p>\n<h4> 5.1.2 PHP-FPM\u7684\u4f5c\u7528\u4e0e\u914d\u7f6e <\/h4>\n<p> PHP-FPM&#xff08;FastCGI Process Manager&#xff09;\u662fPHP\u7684\u4e00\u4e2a\u5b9e\u73b0\u4e86FastCGI\u534f\u8bae\u7684\u8fdb\u7a0b\u7ba1\u7406\u5668&#xff0c;\u5176\u4e3b\u8981\u4f5c\u7528\u662f\u7ba1\u7406PHP\u5904\u7406\u7a0b\u5e8f\u7684\u6267\u884c\u3002\u5b83\u89e3\u51b3\u4e86\u4f20\u7edfCGI\u65b9\u6cd5\u7684\u6027\u80fd\u95ee\u9898&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u8fdb\u7a0b\u63a7\u5236\u529f\u80fd\u3002\u901a\u8fc7PHP-FPM&#xff0c;\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u7684\u3001\u591a\u8fdb\u7a0b\u7684PHP\u5904\u7406\u3002 <\/p>\n<p> PHP-FPM\u5141\u8bb8\u5bf9\u6bcf\u4e2a\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u5355\u72ec\u7684\u8fdb\u7a0b\u6c60&#xff0c;\u6bcf\u4e2a\u8fdb\u7a0b\u6c60\u53ef\u4ee5\u63a7\u5236\u6267\u884c\u7684\u8fdb\u7a0b\u6570\u91cf\u4ee5\u53ca\u8fdb\u7a0b\u7684\u6700\u5927\u542f\u52a8\u65f6\u95f4\u3002\u901a\u8fc7\u5408\u7406\u7684\u914d\u7f6e&#xff0c;\u53ef\u4ee5\u5e73\u8861\u7cfb\u7edf\u8d44\u6e90\u7684\u4f7f\u7528&#xff0c;\u63d0\u5347PHP\u7684\u54cd\u5e94\u901f\u5ea6\u548c\u541e\u5410\u91cf\u3002 <\/p>\n<h3> 5.2 Nginx\u4e0ePHP-FPM\u7684\u96c6\u6210\u5b9e\u8df5 <\/h3>\n<h4> 5.2.1 Nginx\u4e2dPHP-FPM\u7684\u914d\u7f6e\u65b9\u6cd5 <\/h4>\n<p> Nginx\u9700\u8981\u901a\u8fc7fastcgi_pass\u6307\u4ee4\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9PHP-FPM\u8fdb\u884c\u5904\u7406\u3002\u901a\u5e38&#xff0c;\u8fd9\u4e00\u6b65\u6d89\u53ca\u5230\u7f16\u8f91Nginx\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5728\u5408\u9002\u7684server\u5757\u4e2d\u6307\u5b9alocation\u5757&#xff0c;\u5e76\u8bbe\u7f6efastcgi_pass\u6307\u5411PHP-FPM\u76d1\u542c\u7684\u7aef\u53e3\u6216UNIX\u5957\u63a5\u5b57\u3002 <\/p>\n<p> \u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u914d\u7f6e\u793a\u4f8b&#xff1a; <\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name example.com;<\/p>\n<p>    root \/var\/www\/html;<br \/>\n    index index.php index.html index.htm;<\/p>\n<p>    location \/ {<br \/>\n        try_files $uri $uri\/ &#061;404;<br \/>\n    }<\/p>\n<p>    location ~ \\\\.php$ {<br \/>\n        fastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock; # \u8fd9\u91cc\u7684\u8def\u5f84\u6839\u636e\u5b9e\u9645PHP-FPM\u7684UNIX\u5957\u63a5\u5b57\u4f4d\u7f6e\u8fdb\u884c\u4fee\u6539<br \/>\n        fastcgi_index index.php;<br \/>\n        include fastcgi_params;<br \/>\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n        fastcgi_param PATH_INFO $fastcgi_path_info;<br \/>\n    }<br \/>\n}<\/p>\n<h4> 5.2.2 PHP\u811a\u672c\u7684\u8bf7\u6c42\u5904\u7406\u6d41\u7a0b <\/h4>\n<p> \u5f53Nginx\u63a5\u6536\u5230PHP\u811a\u672c\u7684\u8bf7\u6c42\u65f6&#xff0c;\u5b83\u4f1a\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9PHP-FPM\u8fdb\u7a0b\u6c60\u3002PHP-FPM\u5c06\u4ece\u5176\u8fd0\u884c\u7684\u8fdb\u7a0b\u4e2d\u9009\u62e9\u4e00\u4e2a\u6765\u5904\u7406\u8be5\u8bf7\u6c42\u3002\u8fd9\u4e2a\u8fdb\u7a0b\u6267\u884cPHP\u4ee3\u7801\u5e76\u8fd4\u56de\u7ed3\u679c\u7ed9Nginx&#xff0c;Nginx\u968f\u540e\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u6574\u4e2a\u6d41\u7a0b\u662f\u540c\u6b65\u7684&#xff0c;\u6bcf\u4e2aPHP\u8bf7\u6c42\u90fd\u4f1a\u7ecf\u5386\u8fd9\u4e2a\u8fc7\u7a0b\u3002 <\/p>\n<h4> 5.2.3 \u9519\u8bef\u65e5\u5fd7\u7684\u5206\u6790\u4e0e\u8c03\u8bd5 <\/h4>\n<p> \u96c6\u6210\u914d\u7f6e\u5b8c\u6210\u540e&#xff0c;\u786e\u4fddPHP-FPM\u548cNginx\u7684\u9519\u8bef\u65e5\u5fd7\u5df2\u7ecf\u542f\u7528&#xff0c;\u8fd9\u5c06\u6781\u5927\u5730\u65b9\u4fbf\u95ee\u9898\u7684\u8c03\u8bd5\u3002\u5f53\u9047\u5230\u8bf7\u6c42\u5904\u7406\u9519\u8bef\u65f6&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5Nginx\u548cPHP-FPM\u7684\u65e5\u5fd7\u6587\u4ef6\u6765\u8bca\u65ad\u95ee\u9898\u3002\u4f8b\u5982&#xff0c;Nginx\u7684\u9519\u8bef\u65e5\u5fd7\u901a\u5e38\u4f4d\u4e8e  \/var\/log\/nginx\/error.log  &#xff0c;\u800cPHP-FPM\u7684\u65e5\u5fd7\u53ef\u80fd\u5728  \/var\/log\/php7.4-fpm.log  &#xff0c;\u8fd9\u53d6\u51b3\u4e8ePHP\u7684\u7248\u672c\u548c\u5b89\u88c5\u4f4d\u7f6e\u3002 <\/p>\n<p>tail -f \/var\/log\/nginx\/error.log<br \/>\ntail -f \/var\/log\/php7.4-fpm.log<\/p>\n<p> \u901a\u8fc7\u4e0a\u8ff0\u547d\u4ee4\u53ef\u4ee5\u5b9e\u65f6\u67e5\u770b\u6700\u65b0\u7684\u9519\u8bef\u65e5\u5fd7&#xff0c;\u8fd9\u6709\u52a9\u4e8e\u5feb\u901f\u5b9a\u4f4d\u548c\u89e3\u51b3\u95ee\u9898\u3002 <\/p>\n<h3> 5.3 \u6027\u80fd\u4f18\u5316\u4e0e\u5b89\u5168\u8bbe\u7f6e <\/h3>\n<h4> 5.3.1 \u670d\u52a1\u5668\u6027\u80fd\u8c03\u4f18\u5b9e\u8df5 <\/h4>\n<p> \u4f18\u5316Web\u670d\u52a1\u5668\u914d\u7f6e\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u662f\u91cd\u8981\u7684\u7ef4\u62a4\u4efb\u52a1\u3002\u5bf9\u4e8eNginx\u4e0ePHP-FPM\u7684\u914d\u7f6e&#xff0c;\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u4f18\u5316\u5b9e\u8df5&#xff1a; <\/p>\n<ul>\n<li> \u8bbe\u7f6e\u5408\u7406\u7684  fastcgi_read_timeout  &#xff0c;\u4ee5\u907f\u514dPHP\u811a\u672c\u6267\u884c\u8d85\u65f6\u3002 <\/li>\n<li> \u8c03\u6574PHP-FPM\u7684\u8fdb\u7a0b\u6570&#xff0c;\u4f7f\u7528  pm.max_children  \u3001  pm.start_servers  \u3001  pm.min_spare_servers  \u548c  pm.max_spare_servers  \u6307\u4ee4\u6765\u4f18\u5316\u8fdb\u7a0b\u6570\u91cf\u3002 <\/li>\n<li> \u786e\u4fddPHP-FPM\u7684  pm.process_idle_timeout  \u5df2\u7ecf\u8bbe\u7f6e&#xff0c;\u4ee5\u5173\u95ed\u7a7a\u95f2\u8fdb\u7a0b\u3002 <\/li>\n<li> \u4f7f\u7528  opcache  \u52a0\u901fPHP\u4ee3\u7801\u6267\u884c&#xff0c;\u5b83\u662f\u4e00\u4e2aPHP\u5b57\u8282\u7801\u7f13\u5b58&#xff0c;\u53ef\u4ee5\u63d0\u9ad8PHP\u4ee3\u7801\u7684\u6267\u884c\u901f\u5ea6\u3002 <\/li>\n<\/ul>\n<h4> 5.3.2 \u5b89\u5168\u52a0\u56fa\u4e0e\u5e38\u89c1\u653b\u51fb\u9632\u8303 <\/h4>\n<p> \u5b89\u5168\u6027\u4e5f\u662f\u670d\u52a1\u5668\u914d\u7f6e\u7684\u4e00\u4e2a\u91cd\u8981\u65b9\u9762\u3002\u786e\u4fddNginx\u548cPHP-FPM\u7684\u5b89\u5168\u6027\u901a\u5e38\u5305\u62ec&#xff1a; <\/p>\n<ul>\n<li> \u9650\u5236PHP-FPM\u53ef\u6267\u884c\u811a\u672c\u7684\u76ee\u5f55&#xff0c;\u901a\u8fc7\u4fee\u6539  open_basedir  \u6307\u4ee4\u6765\u8bbe\u7f6e\u3002 <\/li>\n<li> \u8bbe\u7f6ePHP-FPM\u7684\u7528\u6237\u548c\u7ec4&#xff0c;\u4ee5\u9650\u5236\u8fdb\u7a0b\u7684\u6743\u9650&#xff0c;\u5e76\u9632\u6b62\u6743\u9650\u63d0\u5347\u3002 <\/li>\n<li> \u4f7f\u7528\u9632\u706b\u5899\u6765\u9650\u5236\u5bf9PHP-FPM\u548cNginx\u7aef\u53e3\u7684\u8bbf\u95ee\u3002 <\/li>\n<li> \u5bf9\u6240\u6709\u7684\u7528\u6237\u8f93\u5165\u8fdb\u884c\u6e05\u7406&#xff0c;\u4ee5\u9632\u6b62SQL\u6ce8\u5165\u7b49\u653b\u51fb\u3002 <\/li>\n<li> \u5b9a\u671f\u66f4\u65b0Nginx\u3001PHP-FPM\u4ee5\u53caPHP\u7248\u672c&#xff0c;\u6765\u4fee\u8865\u5df2\u77e5\u7684\u5b89\u5168\u6f0f\u6d1e\u3002 <\/li>\n<\/ul>\n<p> \u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5&#xff0c;\u53ef\u4ee5\u5927\u5e45\u5ea6\u63d0\u9ad8WNMP\u73af\u5883\u7684\u5b89\u5168\u6027&#xff0c;\u9632\u6b62\u6076\u610f\u653b\u51fb\u548c\u672a\u6388\u6743\u8bbf\u95ee\u3002 <\/p>\n<h2> 6. \u6d4b\u8bd5WNMP\u73af\u5883\u4e0e\u95ee\u9898\u89e3\u51b3 <\/h2>\n<h3> 6.1 \u6d4b\u8bd5WNMP\u73af\u5883 <\/h3>\n<h4> 6.1.1 \u6d4b\u8bd5\u9875\u9762\u7684\u521b\u5efa\u4e0e\u8bbf\u95ee <\/h4>\n<p> \u5728WNMP\u73af\u5883\u642d\u5efa\u5b8c\u6210\u540e&#xff0c;\u9996\u5148\u9700\u8981\u9a8c\u8bc1Nginx\u3001MySQL\u548cPHP\u662f\u5426\u80fd\u591f\u534f\u540c\u5de5\u4f5c\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684PHP\u6d4b\u8bd5\u9875\u9762\u6765\u5b8c\u6210\u8fd9\u4e00\u9a8c\u8bc1\u8fc7\u7a0b\u3002\u9996\u5148&#xff0c;\u6253\u5f00\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668&#xff0c;\u5e76\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a  info.php  \u7684\u6587\u4ef6&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff1a; <\/p>\n<p>&lt;?php<br \/>\nphpinfo();<br \/>\n?&gt;<\/p>\n<p> \u4fdd\u5b58\u6587\u4ef6\u540e&#xff0c;\u5c06\u5176\u653e\u7f6e\u5230Nginx\u7684\u6839\u76ee\u5f55\u4e0b&#xff08;\u901a\u5e38\u662f  \/usr\/local\/nginx\/html  \u6216  \/var\/www\/html  &#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u5b89\u88c5\u8def\u5f84&#xff09;\u3002\u4e4b\u540e&#xff0c;\u91cd\u542fNginx\u670d\u52a1\u4ee5\u786e\u4fdd\u914d\u7f6e\u751f\u6548\u3002 <\/p>\n<p> \u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee  http:\/\/localhost\/info.php  \u6216\u4f60\u7684\u670d\u52a1\u5668IP\u5730\u5740\u540e\u8ddf  \/info.php  &#xff0c;\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u4e00\u4e2a\u8be6\u7ec6\u7684PHP\u73af\u5883\u4fe1\u606f\u9875\u9762\u3002\u8fd9\u4e2a\u9875\u9762\u5217\u51fa\u4e86\u6240\u6709\u7684PHP\u914d\u7f6e\u4fe1\u606f&#xff0c;\u5305\u62ec\u670d\u52a1\u5668\u73af\u5883\u53d8\u91cf\u3001\u6a21\u5757\u4fe1\u606f\u7b49\u3002 <\/p>\n<h4> 6.1.2 \u529f\u80fd\u9a8c\u8bc1\u4e0e\u6027\u80fd\u76d1\u63a7 <\/h4>\n<p> \u6d4b\u8bd5\u9875\u9762\u7684\u521b\u5efa\u53ea\u662f\u521d\u6b65\u7684\u9a8c\u8bc1\u3002\u4e3a\u4e86\u5168\u9762\u6d4b\u8bd5WNMP\u73af\u5883\u7684\u529f\u80fd&#xff0c;\u6211\u4eec\u9700\u8981\u8fdb\u884c\u66f4\u8be6\u5c3d\u7684\u6d4b\u8bd5&#xff0c;\u5305\u62ec&#xff1a; <\/p>\n<ul>\n<li> PHP\u811a\u672c\u7684\u6267\u884c&#xff1a;\u521b\u5efa\u4e00\u4e9bPHP\u811a\u672c&#xff0c;\u6d4b\u8bd5\u6570\u636e\u5e93\u8fde\u63a5\u3001\u6587\u4ef6\u64cd\u4f5c\u7b49\u529f\u80fd\u3002 <\/li>\n<li> MySQL\u6570\u636e\u5e93\u7684\u8bbf\u95ee&#xff1a;\u901a\u8fc7PHP\u8fde\u63a5MySQL\u6570\u636e\u5e93&#xff0c;\u5e76\u6267\u884c\u4e00\u4e9b\u57fa\u672c\u7684\u589e\u5220\u6539\u67e5\u64cd\u4f5c\u3002 <\/li>\n<li> \u6027\u80fd\u76d1\u63a7&#xff1a;\u4f7f\u7528\u6027\u80fd\u76d1\u63a7\u5de5\u5177&#xff08;\u5982Apache\u7684ab\u5de5\u5177\u3001PHP\u7684Xdebug\u7b49&#xff09;\u5bf9\u73af\u5883\u8fdb\u884c\u8d1f\u8f7d\u6d4b\u8bd5&#xff0c;\u5e76\u76d1\u63a7\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002 <\/li>\n<\/ul>\n<p> \u5982\u679c\u4ee5\u4e0a\u6d4b\u8bd5\u5747\u901a\u8fc7&#xff0c;\u8868\u660eWNMP\u73af\u5883\u5df2\u6210\u529f\u642d\u5efa\u5e76\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002\u6027\u80fd\u76d1\u63a7\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u4e86\u89e3\u670d\u52a1\u5668\u7684\u5904\u7406\u80fd\u529b&#xff0c;\u4e3a\u540e\u7eed\u7684\u4f18\u5316\u63d0\u4f9b\u6570\u636e\u652f\u6301\u3002 <\/p>\n<h3> 6.2 Xdebug\u548cPHP-FPM\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e&#xff08;\u53ef\u9009&#xff09; <\/h3>\n<h4> 6.2.1 Xdebug\u7684\u4f5c\u7528\u4e0e\u4f18\u52bf <\/h4>\n<p> Xdebug\u662f\u4e00\u4e2a\u5f00\u6e90\u7684PHP\u6269\u5c55&#xff0c;\u4e3b\u8981\u7528\u4e8e\u63d0\u4f9b\u8c03\u8bd5\u548c\u5206\u6790\u529f\u80fd\u3002\u5b83\u80fd\u591f&#xff1a; <\/p>\n<ul>\n<li> \u63d0\u4f9b\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u73af\u5883&#xff0c;\u5141\u8bb8\u5355\u6b65\u6267\u884c\u4ee3\u7801\u3002 <\/li>\n<li> \u63d0\u4f9b\u5806\u6808\u8ddf\u8e2a\u548c\u53d8\u91cf\u503c\u67e5\u770b\u529f\u80fd\u3002 <\/li>\n<li> \u4e0eIDEs&#xff08;\u5982PHPStorm\u3001NetBeans&#xff09;\u96c6\u6210&#xff0c;\u5b9e\u73b0\u4ee3\u7801\u7f16\u8f91\u548c\u8c03\u8bd5\u7684\u65e0\u7f1d\u7ed3\u5408\u3002 <\/li>\n<\/ul>\n<p> Xdebug\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00&#xff0c;\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177&#xff0c;\u5c24\u5176\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u96be\u4ee5\u89e3\u51b3\u7684\u95ee\u9898\u65f6\u3002 <\/p>\n<h4> 6.2.2 \u5b89\u88c5Xdebug\u4e0ePHP-FPM\u96c6\u6210 <\/h4>\n<p> \u5b89\u88c5Xdebug\u901a\u5e38\u6d89\u53ca\u5230\u4e0b\u8f7dXdebug\u7684\u6e90\u4ee3\u7801\u5e76\u5c06\u5176\u7f16\u8bd1\u5b89\u88c5\u5230PHP\u4e2d\u3002\u4ee5\u4e0b\u662f\u57fa\u672c\u7684\u5b89\u88c5\u6b65\u9aa4&#xff1a; <\/p>\n<ul>\n<li> \u4e0b\u8f7dXdebug\u6e90\u4ee3\u7801\u5305\u5e76\u89e3\u538b\u3002 <\/li>\n<li> \u8fd0\u884c  phpize  \u51c6\u5907\u7f16\u8bd1\u73af\u5883\u3002 <\/li>\n<li> \u914d\u7f6e\u7f16\u8bd1\u9009\u9879&#xff0c;\u52a0\u5165  &#8211;enable-xdebug  \u3002 <\/li>\n<li> \u7f16\u8bd1\u5e76\u5b89\u88c5Xdebug\u6a21\u5757\u3002 <\/li>\n<li> \u66f4\u65b0php.ini\u6587\u4ef6&#xff0c;\u6dfb\u52a0  zend_extension&#061;xdebug.so  &#xff08;\u6839\u636e\u5b9e\u9645\u8def\u5f84\u586b\u5199&#xff09;\u3002 <\/li>\n<\/ul>\n<p> \u96c6\u6210Xdebug\u5230PHP-FPM\u4e2d&#xff0c;\u9700\u8981\u8c03\u6574  php.ini  \u6587\u4ef6\u4e2dXdebug\u7684\u76f8\u5173\u914d\u7f6e&#xff0c;\u786e\u4fdd\u5b83\u80fd\u591f\u4e0ePHP-FPM\u6b63\u5e38\u5de5\u4f5c\u3002 <\/p>\n<h4> 6.2.3 Xdebug\u7684\u8c03\u8bd5\u4e0e\u4f7f\u7528 <\/h4>\n<p> \u914d\u7f6e\u5b8c\u6bd5\u540e&#xff0c;\u91cd\u542fPHP-FPM\u670d\u52a1\u3002\u73b0\u5728\u4f60\u5e94\u8be5\u53ef\u4ee5\u5728\u4f60\u7684IDE\u4e2d\u914d\u7f6eXdebug\u6765\u8c03\u8bd5PHP\u4ee3\u7801\u4e86\u3002\u901a\u5e38\u9700\u8981\u8bbe\u7f6e\u7684Xdebug\u53c2\u6570\u5305\u62ec&#xff1a; <\/p>\n<p>xdebug.remote_enable&#061;1<br \/>\nxdebug.remote_autostart&#061;1<br \/>\nxdebug.remote_connect_back&#061;1<br \/>\nxdebug.remote_port&#061;9000<\/p>\n<p> \u8fd9\u91cc  xdebug.remote_port  \u662fIDE\u7528\u6765\u76d1\u542cXdebug\u8c03\u8bd5\u8bf7\u6c42\u7684\u7aef\u53e3&#xff0c;\u901a\u5e38\u8bbe\u7f6e\u4e3a9000\u3002  xdebug.remote_autostart  \u8bbe\u7f6e\u4e3a1&#xff0c;\u5f53\u6d4f\u89c8\u5668\u5e26\u6709\u7279\u5b9a\u7684GET\u53c2\u6570\u65f6\u4f1a\u81ea\u52a8\u542f\u52a8Xdebug\u3002 <\/p>\n<p> \u5728IDE\u4e2d\u914d\u7f6e\u597dXdebug\u540e&#xff0c;\u8bbe\u7f6e\u597d\u65ad\u70b9&#xff0c;\u542f\u52a8\u8c03\u8bd5\u4f1a\u8bdd&#xff0c;\u5e76\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u4f60\u7684PHP\u5e94\u7528\u3002\u5982\u679c\u4e00\u5207\u8bbe\u7f6e\u6b63\u786e&#xff0c;Xdebug\u4f1a\u5728\u8fbe\u5230\u65ad\u70b9\u65f6\u89e6\u53d1&#xff0c;\u5e76\u5141\u8bb8\u4f60\u8fdb\u884c\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u3002 <\/p>\n<h3> 6.3 \u672c\u5730\u670d\u52a1\u5668\u73af\u5883\u95ee\u9898\u89e3\u51b3\u6307\u5357 <\/h3>\n<h4> 6.3.1 \u5e38\u89c1\u95ee\u9898\u53ca\u6392\u67e5\u65b9\u6cd5 <\/h4>\n<p> \u5728\u4f7f\u7528WNMP\u73af\u5883\u65f6&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230\u5982\u4e0b\u95ee\u9898&#xff1a; <\/p>\n<ul>\n<li> PHP\u9875\u9762\u4e0d\u663e\u793a\u6216502\u9519\u8bef&#xff1a;\u68c0\u67e5Nginx\u548cPHP-FPM\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u786e\u8ba4\u6ca1\u6709\u914d\u7f6e\u9519\u8bef&#xff0c;\u5e76\u786e\u4fdd\u5b83\u4eec\u90fd\u5728\u8fd0\u884c\u3002 <\/li>\n<li> MySQL\u8fde\u63a5\u5931\u8d25&#xff1a;\u68c0\u67e5MySQL\u670d\u52a1\u72b6\u6001&#xff0c;\u786e\u8ba4\u7528\u6237\u6743\u9650\u8bbe\u7f6e\u6b63\u786e&#xff0c;\u5e76\u68c0\u67e5PHP\u8fde\u63a5\u5b57\u7b26\u4e32\u662f\u5426\u6b63\u786e\u3002 <\/li>\n<li> 404 Not Found\u9519\u8bef&#xff1a;\u786e\u4fdd\u8bf7\u6c42\u7684\u6587\u4ef6\u786e\u5b9e\u5b58\u5728\u4e8eNginx\u6307\u5b9a\u7684\u6839\u76ee\u5f55\u4e0b\u3002 <\/li>\n<\/ul>\n<p> \u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u6b65\u9aa4\u901a\u5e38\u5305\u62ec\u68c0\u67e5\u670d\u52a1\u72b6\u6001\u3001\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u3001\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u4ee5\u53ca\u6d4b\u8bd5\u7f51\u7edc\u8fde\u63a5\u3002 <\/p>\n<h4> 6.3.2 \u65e5\u5fd7\u6587\u4ef6\u7684\u89e3\u8bfb\u4e0e\u5e94\u7528 <\/h4>\n<p> \u65e5\u5fd7\u6587\u4ef6\u662f\u8bca\u65ad\u95ee\u9898\u7684\u5173\u952e\u3002Nginx\u3001MySQL\u548cPHP-FPM\u90fd\u6709\u81ea\u5df1\u7684\u65e5\u5fd7\u6587\u4ef6&#xff0c;\u901a\u5e38\u53ef\u4ee5\u5728\u4ee5\u4e0b\u8def\u5f84\u627e\u5230&#xff1a; <\/p>\n<ul>\n<li> Nginx&#xff1a;  \/var\/log\/nginx\/error.log  <\/li>\n<li> MySQL&#xff1a;  \/var\/log\/mysql\/error.log  &#xff08;\u6216\u4f7f\u7528  SHOW ERRORS;  \u547d\u4ee4\u67e5\u8be2&#xff09; <\/li>\n<li> PHP-FPM&#xff1a;  \/var\/log\/php-fpm.log  <\/li>\n<\/ul>\n<p> \u901a\u8fc7\u9605\u8bfb\u548c\u5206\u6790\u8fd9\u4e9b\u65e5\u5fd7\u6587\u4ef6&#xff0c;\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u9519\u8bef\u4fe1\u606f\u3001\u8b66\u544a\u4ee5\u53ca\u6027\u80fd\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f&#xff0c;\u8fd9\u5bf9\u4e8e\u5b9a\u4f4d\u548c\u89e3\u51b3\u670d\u52a1\u5668\u95ee\u9898\u975e\u5e38\u91cd\u8981\u3002 <\/p>\n<h4> 6.3.3 \u7cfb\u7edf\u8d44\u6e90\u548c\u6027\u80fd\u74f6\u9888\u7684\u76d1\u63a7\u4e0e\u4f18\u5316 <\/h4>\n<p> \u76d1\u63a7\u7cfb\u7edf\u8d44\u6e90&#xff08;CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8IO\u7b49&#xff09;\u5bf9\u4e8e\u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u53ef\u4ee5\u4f7f\u7528  top  \u3001  htop  \u3001  iostat  \u7b49\u7cfb\u7edf\u547d\u4ee4\u6216\u5de5\u5177\u6765\u76d1\u63a7\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002 <\/p>\n<p> \u6839\u636e\u76d1\u63a7\u7ed3\u679c&#xff0c;\u6211\u4eec\u53ef\u80fd\u4f1a\u91c7\u53d6\u4ee5\u4e0b\u4f18\u5316\u63aa\u65bd&#xff1a; <\/p>\n<ul>\n<li> \u5bf9\u4e8eCPU\u74f6\u9888&#xff0c;\u53ef\u80fd\u9700\u8981\u4f18\u5316\u5e94\u7528\u4ee3\u7801\u6216\u8c03\u6574Nginx\u548cPHP\u7684\u6027\u80fd\u914d\u7f6e\u3002 <\/li>\n<li> \u5bf9\u4e8e\u5185\u5b58\u95ee\u9898&#xff0c;\u8c03\u6574PHP\u7684\u5185\u5b58\u9650\u5236\u6216\u4f18\u5316\u5e94\u7528\u5185\u5b58\u4f7f\u7528\u3002 <\/li>\n<li> \u5bf9\u4e8e\u78c1\u76d8IO&#xff0c;\u53ef\u80fd\u9700\u8981\u5347\u7ea7\u786c\u4ef6\u6216\u4f18\u5316\u6587\u4ef6\u7cfb\u7edf\u7684\u8bbf\u95ee\u6a21\u5f0f\u3002 <\/li>\n<\/ul>\n<p> \u603b\u4e4b&#xff0c;\u76d1\u63a7\u548c\u4f18\u5316\u662f\u4e00\u4e2a\u6301\u7eed\u7684\u8fc7\u7a0b&#xff0c;\u9700\u8981\u6839\u636e\u5b9e\u9645\u8fd0\u884c\u72b6\u51b5\u4e0d\u65ad\u8c03\u6574\u3002 <\/p>\n<p>  \u672c\u6587\u8fd8\u6709\u914d\u5957\u7684\u7cbe\u54c1\u8d44\u6e90&#xff0c;\u70b9\u51fb\u83b7\u53d6  <img decoding=\"async\" alt=\"menu-r.4af5f7ec.gif\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b4eaa4.gif\" style=\"width:16px;margin-left:4px;vertical-align:text-bottom;cursor:text\" \/> <\/p>\n<p> \u7b80\u4ecb&#xff1a;WNMP\u73af\u5883\u642d\u5efa\u662f\u5728Windows\u7cfb\u7edf\u4e0a\u5b89\u88c5Nginx\u3001MySQL\u548cPHP&#xff0c;\u5efa\u7acb\u672c\u5730Web\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u548c\u6d4b\u8bd5\u5e73\u53f0\u7684\u8fc7\u7a0b\u3002\u672c\u6307\u5357\u8be6\u7ec6\u63cf\u8ff0\u4e86\u4ece\u4e0b\u8f7d\u8f6f\u4ef6\u3001\u5b89\u88c5\u914d\u7f6e\u5230\u6d4b\u8bd5\u8fd0\u884c\u7684\u6574\u4e2a\u6d41\u7a0b&#xff0c;\u5e76\u5bf9\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u548c\u4f18\u5316\u672c\u5730\u670d\u52a1\u5668\u73af\u5883\u3002 <\/p>\n<p>  \u672c\u6587\u8fd8\u6709\u914d\u5957\u7684\u7cbe\u54c1\u8d44\u6e90&#xff0c;\u70b9\u51fb\u83b7\u53d6  <img decoding=\"async\" alt=\"menu-r.4af5f7ec.gif\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b4eaa4.gif\" style=\"width:16px;margin-left:4px;vertical-align:text-bottom;cursor:text\" \/> <\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb711\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf10\u6b21\u3002WNMP\u662f\u4e00\u4e2a\u7531Nginx\u3001MySQL\u548cPHP\u6784\u6210\u7684Web\u670d\u52a1\u5668\u73af\u5883\uff0c\u5b83\u4e3a\u52a8\u6001\u7f51\u7ad9\u548cWeb\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u3001\u8f7b\u91cf\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5728\u5f53\u4eca\u4e92\u8054\u7f51\u5e94\u7528\u7684\u5f00\u53d1\u4e0e\u90e8\u7f72\u4e2d\uff0cWNMP\u73af\u5883\u4ee5\u5176\u5feb\u901f\u3001\u7a33\u5b9a\u548c\u6613\u4e8e\u914d\u7f6e\u7684\u7279\u70b9\uff0c\u9010\u6e10\u6210\u4e3a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002Nginx\u7684\u4f5c\u7528\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a\u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668\uff0c\u5c24\u5176\u5728\u5904\u7406\u9759\u6001\u6587\u4ef6\u65f6\u8868\u73b0\u7a81\u51fa\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u7528\u4e8e\u8d1f\u8f7d\u5747\u8861\u548c\u7f13\u5b58\u9759\u6001\u5185\u5bb9\u3002\u652f\u6301HTTP\u3001HTTPS\u3001SMTP\u3001POP3\u3001IMAP\u7b49\u534f\u8bae\u3002Nginx\u7684\u4f18\u52bf\u5305\u62ec\uff1a\u9ad8\u6027\u80fd\u3002<\/p>\n","protected":false},"author":2,"featured_media":40467,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-40469","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/40469.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb711\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf10\u6b21\u3002WNMP\u662f\u4e00\u4e2a\u7531Nginx\u3001MySQL\u548cPHP\u6784\u6210\u7684Web\u670d\u52a1\u5668\u73af\u5883\uff0c\u5b83\u4e3a\u52a8\u6001\u7f51\u7ad9\u548cWeb\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u3001\u8f7b\u91cf\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5728\u5f53\u4eca\u4e92\u8054\u7f51\u5e94\u7528\u7684\u5f00\u53d1\u4e0e\u90e8\u7f72\u4e2d\uff0cWNMP\u73af\u5883\u4ee5\u5176\u5feb\u901f\u3001\u7a33\u5b9a\u548c\u6613\u4e8e\u914d\u7f6e\u7684\u7279\u70b9\uff0c\u9010\u6e10\u6210\u4e3a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002Nginx\u7684\u4f5c\u7528\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a\u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668\uff0c\u5c24\u5176\u5728\u5904\u7406\u9759\u6001\u6587\u4ef6\u65f6\u8868\u73b0\u7a81\u51fa\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u7528\u4e8e\u8d1f\u8f7d\u5747\u8861\u548c\u7f13\u5b58\u9759\u6001\u5185\u5bb9\u3002\u652f\u6301HTTP\u3001HTTPS\u3001SMTP\u3001POP3\u3001IMAP\u7b49\u534f\u8bae\u3002Nginx\u7684\u4f18\u52bf\u5305\u62ec\uff1a\u9ad8\u6027\u80fd\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40469.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-29T00:06:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b4eaa4.gif\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40469.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40469.html\",\"name\":\"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-29T00:06:36+00:00\",\"dateModified\":\"2025-05-29T00:06:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40469.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40469.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40469.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/40469.html","og_locale":"zh_CN","og_type":"article","og_title":"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb711\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf10\u6b21\u3002WNMP\u662f\u4e00\u4e2a\u7531Nginx\u3001MySQL\u548cPHP\u6784\u6210\u7684Web\u670d\u52a1\u5668\u73af\u5883\uff0c\u5b83\u4e3a\u52a8\u6001\u7f51\u7ad9\u548cWeb\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9ad8\u6548\u3001\u8f7b\u91cf\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5728\u5f53\u4eca\u4e92\u8054\u7f51\u5e94\u7528\u7684\u5f00\u53d1\u4e0e\u90e8\u7f72\u4e2d\uff0cWNMP\u73af\u5883\u4ee5\u5176\u5feb\u901f\u3001\u7a33\u5b9a\u548c\u6613\u4e8e\u914d\u7f6e\u7684\u7279\u70b9\uff0c\u9010\u6e10\u6210\u4e3a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002Nginx\u7684\u4f5c\u7528\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a\u9ad8\u6027\u80fd\u7684Web\u670d\u52a1\u5668\uff0c\u5c24\u5176\u5728\u5904\u7406\u9759\u6001\u6587\u4ef6\u65f6\u8868\u73b0\u7a81\u51fa\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u7528\u4e8e\u8d1f\u8f7d\u5747\u8861\u548c\u7f13\u5b58\u9759\u6001\u5185\u5bb9\u3002\u652f\u6301HTTP\u3001HTTPS\u3001SMTP\u3001POP3\u3001IMAP\u7b49\u534f\u8bae\u3002Nginx\u7684\u4f18\u52bf\u5305\u62ec\uff1a\u9ad8\u6027\u80fd\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/40469.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-29T00:06:36+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529000635-6837a50b4eaa4.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/40469.html","url":"https:\/\/www.wsisp.com\/helps\/40469.html","name":"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-29T00:06:36+00:00","dateModified":"2025-05-29T00:06:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40469.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40469.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40469.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"WNMP\u670d\u52a1\u5668\u73af\u5883\u642d\u5efa\u4e0e\u914d\u7f6e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=40469"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40469\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/40467"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40469"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}