{"id":232029,"date":"2024-05-11T22:31:50","date_gmt":"2024-05-11T14:31:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/232029.html"},"modified":"2024-05-11T22:31:59","modified_gmt":"2024-05-11T14:31:59","slug":"%e6%95%b4%e5%a5%97php%e6%ba%90%e4%bb%a3%e7%a0%81%e5%9c%a8%e6%9c%ac%e5%9c%b0%e6%80%8e%e4%b9%88%e6%b5%8b%e8%af%95%e8%bf%90%e8%a1%8c-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/232029.html","title":{"rendered":"\u6574\u5957php\u6e90\u4ee3\u7801\u5728\u672c\u5730\u600e\u4e48\u6d4b\u8bd5\u8fd0\u884c"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25154254\/b99c3e91-7cea-49b3-9ed6-342da9c4097e.webp\" alt=\"\u6574\u5957php\u6e90\u4ee3\u7801\u5728\u672c\u5730\u600e\u4e48\u6d4b\u8bd5\u8fd0\u884c\" \/><\/p>\n<p><p>\u6574\u5957PHP\u6e90\u4ee3\u7801\u5728\u672c\u5730\u6d4b\u8bd5\u8fd0\u884c\u4e3b\u8981\u6d89\u53ca\u73af\u5883\u642d\u5efa\u3001\u4ee3\u7801\u90e8\u7f72\u3001\u6570\u636e\u5e93\u914d\u7f6e\u548c\u6d4b\u8bd5\u8fd0\u884c\u56db\u4e2a\u5173\u952e\u6b65\u9aa4\u3002<strong>\u9996\u5148\uff0c\u9700\u8981\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u5e76\u914d\u7f6e\u597dPHP\u5f00\u53d1\u73af\u5883\uff0c\u4f8b\u5982\u4f7f\u7528XAMPP\u3001WAMP\u6216MAMP\u7b49\u96c6\u6210\u5f00\u53d1\u73af\u5883<\/strong>\u3002\u8fd9\u4e9b\u96c6\u6210\u73af\u5883\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86PHP\u3001MySQL\u548cApache\u6216Nginx\u7b49\u670d\u52a1\u5668\u8f6f\u4ef6\u7684\u4e00\u952e\u5b89\u88c5\u5305\uff0c\u6781\u5927\u5730\u7b80\u5316\u4e86\u73af\u5883\u642d\u5efa\u7684\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u8bb2\u89e3\u73af\u5883\u642d\u5efa\u7684\u57fa\u672c\u6b65\u9aa4\uff0c\u4ee5XAMPP\u4e3a\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u73af\u5883\u642d\u5efa<\/h3>\n<\/p>\n<p><h4>\u5b89\u88c5XAMPP<\/h4>\n<\/p>\n<p><p>\u8981\u5728\u672c\u5730\u6d4b\u8bd5PHP\u6e90\u4ee3\u7801\uff0c\u9996\u9009\u7684\u65b9\u5f0f\u662f\u5b89\u88c5\u4e00\u4e2a\u96c6\u6210\u7684\u5f00\u53d1\u73af\u5883\uff0c\u5982XAMPP\u3002XAMPP\u662f\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684PHP\u5f00\u53d1\u73af\u5883\uff0c\u5b83\u5305\u62ec\u4e86Apache\u670d\u52a1\u5668\u3001MySQL\u6570\u636e\u5e93\u3001PHP\u548cPerl\u3002\u4e0b\u8f7dXAMPP\u5b89\u88c5\u5305\u540e\uff0c\u6839\u636e\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\uff08Windows\u3001Mac\u6216Linux\uff09\u6267\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u9009\u62e9\u9700\u8981\u5b89\u88c5\u7684\u7ec4\u4ef6\uff0c\u901a\u5e38PHP\u548cMySQL\u662f\u5fc5\u9009\u7684\uff0cApache\u662f\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6a21\u62df\u771f\u5b9e\u7684\u670d\u52a1\u5668\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h4>\u914d\u7f6eApache<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u5bf9Apache\u8fdb\u884c\u7b80\u5355\u7684\u914d\u7f6e\u4ee5\u786e\u4fddPHP\u4ee3\u7801\u53ef\u4ee5\u88ab\u6b63\u786e\u5904\u7406\u3002\u901a\u5e38\uff0cXAMPP\u5b89\u88c5\u5b8c\u6bd5\u540e\uff0cApache\u7684\u914d\u7f6e\u5df2\u7ecf\u53ef\u4ee5\u6ee1\u8db3\u5927\u90e8\u5206\u9700\u8981\uff0c\u4f46\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u4fee\u6539<code>httpd.conf<\/code>\u6587\u4ef6\u6765\u8c03\u6574\u914d\u7f6e\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4fee\u6539<code>DocumentRoot<\/code>\u6307\u4ee4\uff0c\u4ee5\u6307\u5b9aWeb\u6587\u6863\u7684\u6839\u76ee\u5f55\u4f4d\u7f6e\uff0c\u8fd9\u662f\u653e\u7f6ePHP\u6e90\u4ee3\u7801\u7684\u5730\u65b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4ee3\u7801\u90e8\u7f72<\/h3>\n<\/p>\n<p><h4>\u6e90\u4ee3\u7801\u653e\u7f6e<\/h4>\n<\/p>\n<p><p>\u90e8\u7f72PHP\u6e90\u4ee3\u7801\u901a\u5e38\u610f\u5473\u7740\u5c06\u4ee3\u7801\u653e\u7f6e\u5728Apache\u7684Web\u6587\u6863\u6839\u76ee\u5f55\u4e0b\uff0c\u6216\u5176\u5b50\u76ee\u5f55\u4e2d\u3002\u5bf9\u4e8eXAMPP\u6765\u8bf4\uff0c\u9ed8\u8ba4\u7684\u6839\u76ee\u5f55\u662f<code>xampp\/htdocs<\/code>\u3002\u5c06\u6574\u5957PHP\u6e90\u4ee3\u7801\u76f4\u63a5\u590d\u5236\u5230\u8fd9\u4e2a\u76ee\u5f55\u4e2d\uff0c\u6216\u8005\u5728\u5176\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b50\u6587\u4ef6\u5939\uff0c\u5e76\u5c06\u6e90\u4ee3\u7801\u653e\u5230\u65b0\u5efa\u7684\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5982\u679cPHP\u6e90\u4ee3\u7801\u4e2d\u5305\u542b\u6570\u636e\u5e93\u8fde\u63a5\u6216\u5176\u4ed6\u670d\u52a1\u7684\u914d\u7f6e\uff0c\u90a3\u4e48\u5728\u672c\u5730\u8fd0\u884c\u4e4b\u524d\u9700\u8981\u5bf9\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u9002\u5f53\u4fee\u6539\u3002\u8fd9\u901a\u5e38\u6d89\u53ca\u5230\u6570\u636e\u5e93\u8fde\u63a5\u4fe1\u606f\u7684\u66f4\u65b0\uff0c\u5305\u62ec\u6570\u636e\u5e93\u4e3b\u673a\u540d\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u6570\u636e\u5e93\u540d\u7b49\u3002\u786e\u4fdd\u8fd9\u4e9b\u914d\u7f6e\u4e0e\u4f60\u672c\u5730\u5b89\u88c5\u7684MySQL\u6570\u636e\u5e93\u4fe1\u606f\u4e00\u81f4\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u6570\u636e\u5e93\u914d\u7f6e<\/h3>\n<\/p>\n<p><h4>\u521b\u5efa\u6570\u636e\u5e93<\/h4>\n<\/p>\n<p><p>\u6839\u636ePHP\u6e90\u4ee3\u7801\u4e2d\u7684\u8981\u6c42\uff0c\u53ef\u80fd\u9700\u8981\u5728\u672c\u5730MySQL\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7XAMPP\u81ea\u5e26\u7684phpMyAdmin\u7f51\u9875\u754c\u9762\u6765\u521b\u5efa\u3002\u8bbf\u95ee<code>http:\/\/localhost\/phpmyadmin<\/code>\uff0c\u4f7f\u7528\u754c\u9762\u63d0\u4f9b\u7684\u5de5\u5177\u521b\u5efa\u6570\u636e\u5e93\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u6267\u884cSQL\u811a\u672c\u6765\u521b\u5efa\u6570\u636e\u5e93\u548c\u8868\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><h4>\u5bfc\u5165\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u6709\u73b0\u6210\u7684\u6570\u636e\u5bfc\u5165\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7phpMyAdmin\u6765\u5b9e\u73b0\u3002\u5728\u521b\u5efa\u597d\u6570\u636e\u5e93\u4e4b\u540e\uff0c\u5728phpMyAdmin\u4e2d\u9009\u62e9\u5bf9\u5e94\u7684\u6570\u636e\u5e93\uff0c\u7136\u540e\u4f7f\u7528\u201c\u5bfc\u5165\u201d\u529f\u80fd\uff0c\u9009\u62e9SQL\u6587\u4ef6\u63d0\u4ea4\uff0c\u5373\u53ef\u5c06\u6570\u636e\u5bfc\u5165\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u6d4b\u8bd5\u8fd0\u884c<\/h3>\n<\/p>\n<p><h4>\u542f\u52a8\u670d\u52a1\u5668<\/h4>\n<\/p>\n<p><p>\u786e\u4fdd\u6240\u6709\u7684\u670d\u52a1\u90fd\u5df2\u7ecf\u542f\u52a8\uff0c\u5bf9\u4e8eXAMPP\u6765\u8bf4\uff0c\u9700\u8981\u542f\u52a8Apache\u548cMySQL\u670d\u52a1\u3002\u5728XAMPP\u63a7\u5236\u9762\u677f\u4e2d\u70b9\u51fb\u5bf9\u5e94\u7684\u201cStart\u201d\u6309\u94ae\u5373\u53ef\u3002<\/p>\n<\/p>\n<p><h4>\u8fd0\u884c\u4e0e\u8c03\u8bd5<\/h4>\n<\/p>\n<p><p>\u6253\u5f00Web\u6d4f\u89c8\u5668\uff0c\u8f93\u5165<code>http:\/\/localhost\/<\/code>\u52a0\u4e0a\u4f60\u7684\u9879\u76ee\u76ee\u5f55\u540d\u8bbf\u95ee\u4f60\u7684PHP\u5e94\u7528\u3002\u8fd9\u65f6\uff0c\u5982\u679c\u4e00\u5207\u914d\u7f6e\u6b63\u786e\uff0c\u5e94\u7528\u5e94\u8be5\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002\u5982\u679c\u9047\u5230\u9519\u8bef\uff0c\u53ef\u6839\u636e\u9519\u8bef\u4fe1\u606f\u8fdb\u884c\u8c03\u8bd5\u3002\u5e38\u89c1\u7684\u95ee\u9898\u5305\u62ec\u8def\u5f84\u914d\u7f6e\u9519\u8bef\u3001\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u6837\u7684\u6d41\u7a0b\uff0c\u4f60\u53ef\u4ee5\u5728\u672c\u5730\u73af\u5883\u4e2d\u5168\u9762\u6d4b\u8bd5PHP\u6e90\u4ee3\u7801\uff0c\u8fd9\u4e0d\u4ec5\u65b9\u4fbf\u4e86\u5f00\u53d1\u548c\u8c03\u8bd5\uff0c\u4e5f\u4e3a\u6700\u7ec8\u7684\u90e8\u7f72\u5230\u7ebf\u4e0a\u670d\u52a1\u5668\u63d0\u4f9b\u4e86\u5145\u5206\u7684\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u95ee\u98981\uff1a<\/strong> \u5982\u4f55\u5728\u672c\u5730\u6d4b\u8bd5\u8fd0\u884c\u6574\u5957PHP\u6e90\u4ee3\u7801\uff1f<\/p>\n<p><strong>\u56de\u7b541\uff1a<\/strong> \u8981\u5728\u672c\u5730\u6d4b\u8bd5\u8fd0\u884c\u6574\u5957PHP\u6e90\u4ee3\u7801\uff0c\u60a8\u9700\u8981\u642d\u5efa\u4e00\u4e2a\u672c\u5730\u5f00\u53d1\u73af\u5883\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u672c\u5730\u5f00\u53d1\u73af\u5883\uff1a<\/strong> \u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u4e00\u4e2a\u672c\u5730\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u8bf8\u5982XAMPP\u3001WAMP\u3001LAMP\u7b49\u3002\u8fd9\u4e9b\u8f6f\u4ef6\u5305\u542b\u4e86Apache\u670d\u52a1\u5668\u3001MySQL\u6570\u636e\u5e93\u548cPHP\u89e3\u91ca\u5668\u3002\u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u7565\u6709\u4e0d\u540c\uff0c\u4f46\u5927\u591a\u6570\u8f6f\u4ef6\u63d0\u4f9b\u4e86\u53cb\u597d\u7684\u5b89\u88c5\u5411\u5bfc\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5c06\u6e90\u4ee3\u7801\u653e\u7f6e\u5728\u670d\u52a1\u5668\u7f51\u7ad9\u76ee\u5f55\uff1a<\/strong> \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u9700\u8981\u5c06\u6574\u5957PHP\u6e90\u4ee3\u7801\u653e\u7f6e\u5728\u670d\u52a1\u5668\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u3002\u901a\u5e38\u8fd9\u4e2a\u76ee\u5f55\u662fhtdocs\u6216www\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\uff1a<\/strong> \u542f\u52a8\u60a8\u5b89\u88c5\u7684\u672c\u5730\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u786e\u4fddApache\u670d\u52a1\u548cMySQL\u670d\u52a1\u90fd\u5df2\u542f\u52a8\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbf\u95ee\u672c\u5730\u7f51\u7ad9\uff1a<\/strong> \u6253\u5f00\u60a8\u7684\u6d4f\u89c8\u5668\uff0c\u5e76\u5728\u5730\u5740\u680f\u4e2d\u8f93\u5165<a href=\"http:\/\/localhost%E6%88%96%E8%80%85http:\/\/127.0.0.1%E6%9D%A5%E8%AE%BF%E9%97%AE%E6%82%A8%E7%9A%84%E6%9C%AC%E5%9C%B0%E7%BD%91%E7%AB%99%E3%80%82%E6%A0%B9%E6%8D%AE%E6%82%A8%E7%9A%84%E6%BA%90%E4%BB%A3%E7%A0%81%EF%BC%8C%E6%82%A8%E5%8F%AF%E8%83%BD%E9%9C%80%E8%A6%81%E5%9C%A8URL%E5%90%8E%E9%9D%A2%E5%8A%A0%E4%B8%8A%E7%9B%B8%E5%BA%94%E7%9A%84%E6%96%87%E4%BB%B6%E8%B7%AF%E5%BE%84%E3%80%82\">http:\/\/localhost\u6216\u8005http:\/\/127.0.0.1\u6765\u8bbf\u95ee\u60a8\u7684\u672c\u5730\u7f51\u7ad9\u3002\u6839\u636e\u60a8\u7684\u6e90\u4ee3\u7801\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5728URL\u540e\u9762\u52a0\u4e0a\u76f8\u5e94\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/a><\/p>\n<\/li>\n<li>\n<p><strong>\u6d4b\u8bd5\u8fd0\u884c\uff1a<\/strong> \u73b0\u5728\uff0c\u60a8\u5e94\u8be5\u80fd\u591f\u5728\u672c\u5730\u6d4f\u89c8\u5668\u4e2d\u770b\u5230\u60a8\u7684PHP\u7f51\u7ad9\u3002\u901a\u8fc7\u6d4f\u89c8\u4e0d\u540c\u9875\u9762\u548c\u4ea4\u4e92\u529f\u80fd\uff0c\u6d4b\u8bd5\u60a8\u7684\u6e90\u4ee3\u7801\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u8bf7\u8bb0\u4f4f\uff0c\u8fd9\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6982\u8ff0\uff0c\u5b9e\u9645\u7684\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\u53ef\u4ee5\u53c2\u8003\u60a8\u4f7f\u7528\u7684\u672c\u5730\u670d\u52a1\u5668\u8f6f\u4ef6\u7684\u5b98\u65b9\u6587\u6863\u6216\u5728\u7ebf\u6559\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6574\u5957PHP\u6e90\u4ee3\u7801\u5728\u672c\u5730\u6d4b\u8bd5\u8fd0\u884c\u4e3b\u8981\u6d89\u53ca\u73af\u5883\u642d\u5efa\u3001\u4ee3\u7801\u90e8\u7f72\u3001\u6570\u636e\u5e93\u914d\u7f6e\u548c\u6d4b\u8bd5\u8fd0\u884c\u56db\u4e2a\u5173\u952e\u6b65\u9aa4\u3002\u9996\u5148\uff0c\u9700\u8981\u5728\u672c\u5730\u8ba1 [&hellip;]","protected":false},"author":3,"featured_media":232037,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/232029"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=232029"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/232029\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/232037"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=232029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=232029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=232029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}