{"id":20777,"date":"2024-11-19T14:32:22","date_gmt":"2024-11-19T06:32:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20777\/"},"modified":"2024-11-19T14:32:22","modified_gmt":"2024-11-19T06:32:22","slug":"phpstorm%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cphp%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20777\/","title":{"rendered":"phpstorm\u600e\u4e48\u8fd0\u884cphp\u4ee3\u7801"},"content":{"rendered":"<blockquote><p>\n  \u5728 phpstorm \u4e2d\u8fd0\u884c php \u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u5feb\u901f\u8fd0\u884c\u3001\u914d\u7f6e\u8fd0\u884c\u914d\u7f6e\u3001\u8fd0\u884c\u5e26\u6709\u53c2\u6570\u3001\u8c03\u8bd5\u4ee3\u7801\u3001\u521b\u5efa\u5feb\u6377\u65b9\u5f0f\u3001\u4f7f\u7528 xdebug \u6269\u5c55\uff0c\u4ee5\u53ca\u5c06\u5176\u4e0e\u5176\u4ed6\u5de5\u5177\u96c6\u6210\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/07\/2024040721392447804.jpg\" class=\"aligncenter\" title=\"phpstorm\u600e\u4e48\u8fd0\u884cphp\u4ee3\u7801\u63d2\u56fe\" alt=\"phpstorm\u600e\u4e48\u8fd0\u884cphp\u4ee3\u7801\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 PHPStorm \u4e2d\u8fd0\u884c PHP \u4ee3\u7801<\/strong><\/p>\n<p><strong>\u5feb\u901f\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u4f7f\u7528\u5feb\u6377\u952e\uff1a<\/strong><\/p>\n<ul>\n<li>Mac\uff1aCmd + R<\/li>\n<li>Windows\/Linux\uff1aCtrl + R<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u83dc\u5355\uff1a<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>Run \u2192 Run<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5355\u51fb\u5de5\u5177\u680f\u4e0a\u7684\u7eff\u8272\u7bad\u5934\u56fe\u6807<\/strong><\/li>\n<\/ul>\n<p><strong>\u914d\u7f6e\u8fd0\u884c\u914d\u7f6e<\/strong><\/p>\n<ul>\n<li>\u5728 &#8220;Run&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9\u60a8\u7684 PHP \u89e3\u91ca\u5668\u3002<\/li>\n<li>\u6307\u5b9a PHP \u811a\u672c\u7684\u8def\u5f84\u3002<\/li>\n<li>\n<p>\u8bbe\u7f6e\u5176\u4ed6\u53c2\u6570\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\u5ba2\u6237\u7aef\u8def\u5f84<\/li>\n<li>stdin \u8f93\u5165<\/li>\n<li>\u5de5\u4f5c\u76ee\u5f55<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u8fd0\u884c\u5e26\u6709\u53c2\u6570\u7684\u4ee3\u7801<\/strong><\/p>\n<p>\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee3\u7801\u5e76\u4f20\u9012\u53c2\u6570\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u5728 &#8220;Run&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9 &#8220;Edit configurations&#8230;&#8221;\u3002<\/li>\n<li>\u5728 &#8220;Arguments&#8221; \u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/li>\n<li>\u786e\u4fdd &#8220;Run with parameters&#8221; \u9009\u9879\u5df2\u9009\u4e2d\u3002<\/li>\n<\/ul>\n<p><strong>\u8c03\u8bd5\u4ee3\u7801<\/strong><\/p>\n<p>\u8981\u8c03\u8bd5\u4ee3\u7801\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u5728\u8981\u8c03\u8bd5\u7684\u884c\u4e0a\u8bbe\u7f6e\u65ad\u70b9\u3002<\/li>\n<li>\u5355\u51fb\u5de5\u5177\u680f\u4e0a\u7684 &#8220;Debug&#8221; \u6309\u94ae\u3002<\/li>\n<li>\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\uff08\u4f8b\u5982\uff1a\u53d8\u91cf\u67e5\u770b\u5668\u3001\u5806\u6808\u8ddf\u8e2a\uff09\u8fdb\u884c\u8c03\u8bd5\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u9009\u9879<\/strong><\/p>\n<ul>\n<li> <strong>\u521b\u5efa\u8fd0\u884c\/\u8c03\u8bd5\u5feb\u6377\u65b9\u5f0f\uff1a<\/strong>\u53f3\u952e\u5355\u51fb\u9879\u76ee\u6811\u4e2d\u7684 PHP \u6587\u4ef6\uff0c\u7136\u540e\u9009\u62e9 &#8220;Create &#8216;Run'&#8221; \u6216 &#8220;Create &#8216;Debug'&#8221;\u3002<\/li>\n<li> <strong>\u4f7f\u7528 Xdebug\uff1a<\/strong>\u5b89\u88c5 Xdebug \u6269\u5c55\u4ee5\u589e\u5f3a\u8c03\u8bd5\u529f\u80fd\u3002<\/li>\n<li> <strong>\u5c06\u5176\u4e0e\u5176\u4ed6\u5de5\u5177\u96c6\u6210\uff1a<\/strong>\u5c06 PHPStorm \u4e0e\u5176\u4ed6\u5de5\u5177\uff08\u4f8b\u5982\uff1aComposer\u3001 PHPUnit\uff09\u96c6\u6210\u4ee5\u7b80\u5316\u5f00\u53d1\u6d41\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8fd0\u884cphp\u4ee3\u7801\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 phpstorm \u4e2d\u8fd0\u884c php \u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u5feb\u901f\u8fd0\u884c\u3001\u914d\u7f6e\u8fd0\u884c\u914d\u7f6e\u3001\u8fd0\u884c\u5e26\u6709\u53c2\u6570\u3001\u8c03\u8bd5\u4ee3\u7801\u3001\u521b\u5efa\u5feb\u6377\u65b9\u5f0f\u3001\u4f7f\u7528 xdebug \u6269\u5c55\uff0c\u4ee5\u53ca\u5c06\u5176\u4e0e\u5176\u4ed6\u5de5\u5177\u96c6\u6210\u3002 \u5982\u4f55\u5728 PHPStorm \u4e2d\u8fd0\u884c PHP \u4ee3\u7801 \u5feb\u901f\u8fd0\u884c\u4ee3\u7801 \u4f7f\u7528\u5feb\u6377\u952e\uff1a Mac\uff1aCmd + R Windows\/Linux\uff1aCtrl + R \u4f7f\u7528\u83dc\u5355\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b Run \u2192 Run \u5355\u51fb\u5de5\u5177\u680f\u4e0a\u7684\u7eff\u8272\u7bad\u5934\u56fe\u6807 \u914d\u7f6e\u8fd0\u884c\u914d\u7f6e \u5728 &#8220;Run&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9\u60a8\u7684 PHP \u89e3\u91ca\u5668\u3002 \u6307\u5b9a PHP \u811a\u672c\u7684\u8def\u5f84\u3002 \u8bbe\u7f6e\u5176\u4ed6\u53c2\u6570\uff0c\u4f8b\u5982\uff1a \u5ba2\u6237\u7aef\u8def\u5f84 stdin \u8f93\u5165 \u5de5\u4f5c\u76ee\u5f55 \u8fd0\u884c\u5e26\u6709\u53c2\u6570\u7684\u4ee3\u7801 \u8981\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee3\u7801\u5e76\u4f20\u9012\u53c2\u6570\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u5728 &#8220;Run&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9 &#8220;Edit configurations&#8230;&#8221;\u3002 \u5728 &#8220;Arguments&#8221; \u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165\u547d\u4ee4\u884c\u53c2\u6570\u3002 \u786e\u4fdd &#8220;Run with parameters&#8221; \u9009\u9879\u5df2\u9009\u4e2d\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20777","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20777"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20777\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}