{"id":53175,"date":"2024-10-09T08:58:13","date_gmt":"2024-10-09T00:58:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/53175\/"},"modified":"2024-10-09T08:58:13","modified_gmt":"2024-10-09T00:58:13","slug":"apachephpmysql-%e5%9c%a8-windows-%e4%b8%8b%e9%85%8d%e7%bd%ae%e7%92%b0%e5%a2%83%e6%ad%a5%e9%a9%9f%e8%aa%aa%e6%98%8e","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/53175\/","title":{"rendered":"Apache+PHP+MySQL \u5728 Windows \u4e0b\u914d\u7f6e\u74b0\u5883\u6b65\u9a5f\u8aaa\u660e"},"content":{"rendered":"<h1 id=\"apachephpmysql-%e5%9c%a8-windows-%e4%b8%8b%e9%85%8d%e7%bd%ae%e7%92%b0%e5%a2%83%e6%ad%a5%e9%a9%9f%e8%aa%aa%e6%98%8e-DUSFHAHiMA\">Apache+PHP+MySQL \u5728 Windows \u4e0b\u914d\u7f6e\u74b0\u5883\u6b65\u9a5f\u8aaa\u660e<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u958b\u767c\u4e2d\uff0cApache\u3001PHP \u548c MySQL \u662f\u6700\u53d7\u6b61\u8fce\u7684\u6280\u8853\u7d44\u5408\u4e4b\u4e00\u3002\u9019\u4e09\u8005\u7684\u7d44\u5408\u4e0d\u50c5\u5f37\u5927\uff0c\u9084\u80fd\u5920\u652f\u6301\u5404\u7a2e\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5e8f\u7684\u958b\u767c\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 Windows \u74b0\u5883\u4e0b\u914d\u7f6e Apache\u3001PHP \u548c MySQL\uff0c\u8b93\u60a8\u80fd\u5920\u5feb\u901f\u642d\u5efa\u81ea\u5df1\u7684\u958b\u767c\u74b0\u5883\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e4%b8%8b%e8%bc%89%e6%89%80%e9%9c%80%e8%bb%9f%e4%bb%b6-DUSFHAHiMA\">\u6b65\u9a5f\u4e00\uff1a\u4e0b\u8f09\u6240\u9700\u8edf\u4ef6<\/h2>\n<ul>\n<li><strong>Apache HTTP Server\uff1a<\/strong>\u8a2a\u554f <a href=\"https:\/\/httpd.apache.org\/download.cgi\" rel=\"nofollow noopener\" target=\"_blank\">Apache \u5b98\u65b9\u7db2\u7ad9<\/a> \u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 Apache\u3002<\/li>\n<li><strong>PHP\uff1a<\/strong>\u524d\u5f80 <a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">PHP \u5b98\u65b9\u7db2\u7ad9<\/a> \u4e0b\u8f09\u9069\u5408 Windows \u7684 PHP \u7248\u672c\u3002<\/li>\n<li><strong>MySQL\uff1a<\/strong>\u8a2a\u554f <a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\" rel=\"nofollow noopener\" target=\"_blank\">MySQL \u5b98\u65b9\u7db2\u7ad9<\/a> \u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 MySQL\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e5%ae%89%e8%a3%9d-apache-DUSFHAHiMA\">\u6b65\u9a5f\u4e8c\uff1a\u5b89\u88dd Apache<\/h2>\n<ol>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684 Apache \u5b89\u88dd\u5305\uff0c\u5c07\u5176\u653e\u7f6e\u5728 C:Apache24 \u76ee\u9304\u4e0b\u3002<\/li>\n<li>\u6253\u958b\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u9032\u5165 Apache \u7684 bin \u76ee\u9304\uff0c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88dd Apache \u670d\u52d9\uff1a<\/li>\n<pre><code>httpd -k install<\/code><\/pre>\n<li>\u555f\u52d5 Apache \u670d\u52d9\uff0c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<pre><code>httpd -k start<\/code><\/pre>\n<li>\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost<\/code>\uff0c\u5982\u679c\u770b\u5230 Apache \u7684\u6b61\u8fce\u9801\u9762\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e5%ae%89%e8%a3%9d-php-DUSFHAHiMA\">\u6b65\u9a5f\u4e09\uff1a\u5b89\u88dd PHP<\/h2>\n<ol>\n<li>\u89e3\u58d3\u7e2e PHP \u5b89\u88dd\u5305\uff0c\u5c07\u5176\u653e\u7f6e\u5728 C:php \u76ee\u9304\u4e0b\u3002<\/li>\n<li>\u5c07 PHP \u7684 bin \u76ee\u9304\u6dfb\u52a0\u5230\u7cfb\u7d71\u74b0\u5883\u8b8a\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u4f7f\u7528 PHP\u3002<\/li>\n<li>\u5728 Apache \u7684\u914d\u7f6e\u6587\u4ef6 httpd.conf \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u78bc\uff0c\u4ee5\u4fbf Apache \u80fd\u5920\u8655\u7406 PHP \u6587\u4ef6\uff1a<\/li>\n<pre><code>LoadModule php_module \"C:\/php\/php7apache2_4.dll\"\nAddType application\/x-httpd-php .php\nPHPIniDir \"C:\/php\"<\/code><\/pre>\n<li>\u91cd\u555f Apache \u670d\u52d9\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\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-mysql-DUSFHAHiMA\">\u6b65\u9a5f\u56db\uff1a\u5b89\u88dd MySQL<\/h2>\n<ol>\n<li>\u904b\u884c MySQL \u5b89\u88dd\u7a0b\u5e8f\uff0c\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88dd\u3002<\/li>\n<li>\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u8a2d\u7f6e root \u7528\u6236\u7684\u5bc6\u78bc\uff0c\u4e26\u8a18\u4f4f\u8a72\u5bc6\u78bc\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 MySQL Workbench \u6216\u547d\u4ee4\u884c\u5de5\u5177\u4f86\u7ba1\u7406\u6578\u64da\u5eab\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%94%ef%bc%9a%e6%b8%ac%e8%a9%a6%e7%92%b0%e5%a2%83-DUSFHAHiMA\">\u6b65\u9a5f\u4e94\uff1a\u6e2c\u8a66\u74b0\u5883<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fdd\u6240\u6709\u7d44\u4ef6\u90fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684 PHP \u6e2c\u8a66\u6587\u4ef6\u3002\u5728 C:Apache24htdocs \u76ee\u9304\u4e0b\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>info.php<\/code> \u7684\u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u78bc\uff1a<\/p>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n<p>\u7136\u5f8c\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost\/info.php<\/code>\uff0c\u5982\u679c\u80fd\u770b\u5230 PHP \u7684\u4fe1\u606f\u9801\u9762\uff0c\u5247\u8868\u793a\u60a8\u7684\u74b0\u5883\u914d\u7f6e\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-DUSFHAHiMA\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5728 Windows \u74b0\u5883\u4e0b\u914d\u7f6e\u4e86 Apache\u3001PHP \u548c MySQL\u3002\u9019\u4e00\u7d44\u5408\u70ba\u60a8\u7684\u7db2\u7ad9\u958b\u767c\u63d0\u4f9b\u4e86\u5f37\u5927\u7684\u652f\u6301\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u670d\u52d9\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u63d0\u5347\u60a8\u7684\u7db2\u7ad9\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002\u7121\u8ad6\u662f\u500b\u4eba\u9805\u76ee\u9084\u662f\u5546\u696d\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a> \u89e3\u6c7a\u65b9\u6848\u90fd\u80fd\u8b93\u60a8\u7684\u958b\u767c\u5de5\u4f5c\u66f4\u52a0\u9806\u5229\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Windows \u4e0a\u914d\u7f6e Apache\u3001PHP \u548c MySQL \u74b0\u5883\u7684\u8a73\u7d30\u6b65\u9a5f\uff0c\u8f15\u9b06\u642d\u5efa\u4f60\u7684\u958b\u767c\u5e73\u53f0\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-53175","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53175","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=53175"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53175\/revisions"}],"predecessor-version":[{"id":53176,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53175\/revisions\/53176"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=53175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=53175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=53175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}