{"id":54259,"date":"2024-10-09T17:59:18","date_gmt":"2024-10-09T09:59:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54259\/"},"modified":"2024-10-09T17:59:18","modified_gmt":"2024-10-09T09:59:18","slug":"windows-%e7%92%b0%e5%a2%83%e4%b8%8b-php-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83%e6%90%ad%e5%bb%ba-%e5%9c%96%e6%96%87%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54259\/","title":{"rendered":"Windows \u74b0\u5883\u4e0b PHP \u958b\u767c\u74b0\u5883\u642d\u5efa &#8211; \u5716\u6587\u5b8c\u5168\u6559\u7a0b"},"content":{"rendered":"<h1 id=\"windows-%e7%92%b0%e5%a2%83%e4%b8%8b-php-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83%e6%90%ad%e5%bb%ba-%e5%9c%96%e6%96%87%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b-QezrWOzjsE\">Windows \u74b0\u5883\u4e0b PHP \u958b\u767c\u74b0\u5883\u642d\u5efa &#8211; \u5716\u6587\u5b8c\u5168\u6559\u7a0b<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u958b\u767c\u4e2d\uff0cPHP \u662f\u4e00\u7a2e\u5ee3\u6cdb\u4f7f\u7528\u7684\u4f3a\u670d\u5668\u7aef\u8173\u672c\u8a9e\u8a00\u3002\u7121\u8ad6\u662f\u958b\u767c\u7db2\u7ad9\u9084\u662f\u7db2\u7d61\u61c9\u7528\uff0c\u642d\u5efa\u4e00\u500b\u5408\u9069\u7684\u958b\u767c\u74b0\u5883\u90fd\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Windows \u74b0\u5883\u4e0b\u642d\u5efa PHP \u958b\u767c\u74b0\u5883\uff0c\u4e26\u63d0\u4f9b\u8a73\u7d30\u7684\u6b65\u9a5f\u548c\u5716\u6587\u8aaa\u660e\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e5%ae%89%e8%a3%9d-xampp-QezrWOzjsE\">\u6b65\u9a5f\u4e00\uff1a\u5b89\u88dd XAMPP<\/h2>\n<p>XAMPP \u662f\u4e00\u500b\u514d\u8cbb\u4e14\u958b\u6e90\u7684\u8de8\u5e73\u53f0\u7db2\u9801\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\u5806\u758a\uff0c\u5305\u542b Apache\u3001MySQL\u3001PHP \u548c Perl\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd XAMPP \u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554f <a href=\"https:\/\/www.apachefriends.org\/index.html\" rel=\"nofollow noopener\" target=\"_blank\">XAMPP \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u4e0b\u8f09\u9069\u5408 Windows \u7684\u5b89\u88dd\u5305\u3002<\/li>\n<li>\u904b\u884c\u4e0b\u8f09\u7684\u5b89\u88dd\u7a0b\u5f0f\uff0c\u4e26\u6309\u7167\u63d0\u793a\u9032\u884c\u5b89\u88dd\u3002\u5efa\u8b70\u9078\u64c7\u9ed8\u8a8d\u8a2d\u7f6e\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 XAMPP \u63a7\u5236\u9762\u677f\uff0c\u555f\u52d5 Apache \u548c MySQL \u670d\u52d9\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e9%85%8d%e7%bd%ae-php-%e7%92%b0%e5%a2%83-QezrWOzjsE\">\u6b65\u9a5f\u4e8c\uff1a\u914d\u7f6e PHP \u74b0\u5883<\/h2>\n<p>\u5b89\u88dd XAMPP \u5f8c\uff0c\u60a8\u9700\u8981\u9032\u884c\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\u4ee5\u78ba\u4fdd PHP \u6b63\u5e38\u904b\u884c\uff1a<\/p>\n<ol>\n<li>\u6253\u958b XAMPP \u63a7\u5236\u9762\u677f\uff0c\u9ede\u64ca\u300cConfig\u300d\u6309\u9215\uff0c\u9078\u64c7\u300cphp.ini\u300d\u3002<\/li>\n<li>\u5728 php.ini \u6587\u4ef6\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6839\u64da\u9700\u8981\u555f\u7528\u6216\u7981\u7528\u64f4\u5c55\u3002\u4f8b\u5982\uff0c\u82e5\u8981\u555f\u7528 cURL\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a<\/li>\n<pre><code>;extension=curl<\/code><\/pre>\n<li>\u5c07\u884c\u524d\u7684\u5206\u865f\uff08;\uff09\u522a\u9664\uff0c\u7136\u5f8c\u4fdd\u5b58\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e6%b8%ac%e8%a9%a6-php-%e7%92%b0%e5%a2%83-QezrWOzjsE\">\u6b65\u9a5f\u4e09\uff1a\u6e2c\u8a66 PHP \u74b0\u5883<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fdd PHP \u74b0\u5883\u5df2\u6b63\u78ba\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684 PHP \u6e2c\u8a66\u6587\u4ef6\uff1a<\/p>\n<ol>\n<li>\u5728 XAMPP \u5b89\u88dd\u76ee\u9304\u4e0b\u7684 <code>htdocs<\/code> \u6587\u4ef6\u593e\u4e2d\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>test.php<\/code> \u7684\u6587\u4ef6\u3002<\/li>\n<li>\u5728 <code>test.php<\/code> \u6587\u4ef6\u4e2d\u8f38\u5165\u4ee5\u4e0b\u4ee3\u78bc\uff1a<\/li>\n<pre><code>&lt;?php\n    phpinfo();\n    ?&gt;<\/code><\/pre>\n<li>\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost\/test.php<\/code>\uff0c\u60a8\u61c9\u8a72\u80fd\u770b\u5230 PHP \u7684\u914d\u7f6e\u4fe1\u606f\u9801\u9762\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%9b%9b%ef%bc%9a%e5%ae%89%e8%a3%9d-composer-QezrWOzjsE\">\u6b65\u9a5f\u56db\uff1a\u5b89\u88dd Composer<\/h2>\n<p>Composer \u662f PHP \u7684\u4f9d\u8cf4\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u5e6b\u52a9\u60a8\u8f15\u9b06\u7ba1\u7406\u9805\u76ee\u4e2d\u7684\u5eab\u548c\u4f9d\u8cf4\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd Composer \u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554f <a href=\"https:\/\/getcomposer.org\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">Composer \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u4e0b\u8f09 Windows \u5b89\u88dd\u7a0b\u5f0f\u3002<\/li>\n<li>\u904b\u884c\u5b89\u88dd\u7a0b\u5f0f\uff0c\u4e26\u6309\u7167\u63d0\u793a\u9032\u884c\u5b89\u88dd\u3002\u78ba\u4fdd\u9078\u64c7\u4e86 PHP \u7684\u6b63\u78ba\u8def\u5f91\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f38\u5165 <code>composer<\/code> \u4f86\u6aa2\u67e5\u662f\u5426\u5b89\u88dd\u6210\u529f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%94%ef%bc%9a%e4%bd%bf%e7%94%a8-ide-%e9%80%b2%e8%a1%8c%e9%96%8b%e7%99%bc-QezrWOzjsE\">\u6b65\u9a5f\u4e94\uff1a\u4f7f\u7528 IDE \u9032\u884c\u958b\u767c<\/h2>\n<p>\u9078\u64c7\u4e00\u500b\u5408\u9069\u7684\u96c6\u6210\u958b\u767c\u74b0\u5883\uff08IDE\uff09\u53ef\u4ee5\u63d0\u9ad8\u958b\u767c\u6548\u7387\u3002\u4ee5\u4e0b\u662f\u5e7e\u500b\u5e38\u7528\u7684 PHP IDE\uff1a<\/p>\n<ul>\n<li><strong>PHPStorm\uff1a<\/strong>\u529f\u80fd\u5f37\u5927\uff0c\u652f\u6301\u591a\u7a2e\u6846\u67b6\u548c\u5de5\u5177\u3002<\/li>\n<li><strong>Visual Studio Code\uff1a<\/strong>\u8f15\u91cf\u7d1a\u4e14\u64f4\u5c55\u6027\u5f37\uff0c\u9069\u5408\u5404\u7a2e\u958b\u767c\u9700\u6c42\u3002<\/li>\n<li><strong>NetBeans\uff1a<\/strong>\u958b\u6e90\u4e14\u652f\u6301\u591a\u7a2e\u8a9e\u8a00\uff0c\u9069\u5408\u521d\u5b78\u8005\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-QezrWOzjsE\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows \u74b0\u5883\u4e0b\u642d\u5efa PHP \u958b\u767c\u74b0\u5883\u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u901a\u904e\u5b89\u88dd XAMPP\u3001\u914d\u7f6e PHP\u3001\u6e2c\u8a66\u74b0\u5883\u3001\u5b89\u88dd Composer \u4ee5\u53ca\u9078\u64c7\u5408\u9069\u7684 IDE\uff0c\u60a8\u5c31\u53ef\u4ee5\u958b\u59cb\u9032\u884c PHP \u958b\u767c\u4e86\u3002\u82e5\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u958b\u767c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u4f86\u90e8\u7f72\u60a8\u7684\u61c9\u7528\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Windows \u74b0\u5883\u4e0b\u642d\u5efa PHP \u958b\u767c\u74b0\u5883\uff0c\u63d0\u4f9b\u8a73\u7d30\u5716\u6587\u6559\u7a0b\uff0c\u52a9\u4f60\u8f15\u9b06\u958b\u59cb PHP \u958b\u767c\u4e4b\u65c5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-54259","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=54259"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54259\/revisions"}],"predecessor-version":[{"id":54260,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54259\/revisions\/54260"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}