{"id":54293,"date":"2024-10-09T18:13:19","date_gmt":"2024-10-09T10:13:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54293\/"},"modified":"2024-10-09T18:13:19","modified_gmt":"2024-10-09T10:13:19","slug":"windows-%e4%b8%8b-apache-php-mysql-%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54293\/","title":{"rendered":"Windows \u4e0b Apache + PHP + MySQL \u74b0\u5883\u914d\u7f6e\u65b9\u6cd5"},"content":{"rendered":"<h1 id=\"windows-%e4%b8%8b-apache-php-mysql-%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae%e6%96%b9%e6%b3%95-LcIAFYxlmR\">Windows \u4e0b Apache + PHP + MySQL \u74b0\u5883\u914d\u7f6e\u65b9\u6cd5<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u642d\u5efa\u4e00\u500b\u7a69\u5b9a\u4e14\u9ad8\u6548\u7684\u4f3a\u670d\u5668\u74b0\u5883\u662f\u958b\u767c\u548c\u904b\u884c\u7db2\u7ad9\u7684\u57fa\u790e\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Windows \u7cfb\u7d71\u4e0b\u914d\u7f6e Apache\u3001PHP \u548c MySQL \u74b0\u5883\uff0c\u9019\u4e09\u8005\u7684\u7d44\u5408\u88ab\u5ee3\u6cdb\u7a31\u70ba WAMP\uff08Windows, Apache, MySQL, PHP\uff09\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-apache-LcIAFYxlmR\">\u6b65\u9a5f\u4e00\uff1a\u4e0b\u8f09\u548c\u5b89\u88dd Apache<\/h2>\n<p>\u9996\u5148\uff0c\u6211\u5011\u9700\u8981\u4e0b\u8f09 Apache HTTP Server\u3002\u53ef\u4ee5\u5f9e Apache \u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/httpd.apache.org\/download.cgi\" rel=\"nofollow noopener\" target=\"_blank\">httpd.apache.org<\/a>\uff09\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 Apache\u3002<\/p>\n<ul>\n<li>\u9078\u64c7\u9069\u5408 Windows \u7684\u7248\u672c\uff0c\u901a\u5e38\u662f .msi \u683c\u5f0f\u7684\u5b89\u88dd\u5305\u3002<\/li>\n<li>\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\uff0c\u4e26\u6309\u7167\u63d0\u793a\u9032\u884c\u5b89\u88dd\u3002<\/li>\n<li>\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u9078\u64c7\u5b89\u88dd\u76ee\u9304\uff0c\u5efa\u8b70\u4f7f\u7528\u9ed8\u8a8d\u8def\u5f91\u3002<\/li>\n<\/ul>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost<\/code> \u4f86\u6aa2\u67e5 Apache \u662f\u5426\u6210\u529f\u904b\u884c\u3002\u5982\u679c\u770b\u5230 Apache \u7684\u6b61\u8fce\u9801\u9762\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-php-LcIAFYxlmR\">\u6b65\u9a5f\u4e8c\uff1a\u4e0b\u8f09\u548c\u5b89\u88dd PHP<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd PHP\u3002\u53ef\u4ee5\u5f9e PHP \u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">windows.php.net<\/a>\uff09\u4e0b\u8f09\u9069\u5408 Windows \u7684 PHP \u7248\u672c\u3002<\/p>\n<ul>\n<li>\u9078\u64c7 Thread Safe \u7248\u672c\uff0c\u4e26\u4e0b\u8f09 .zip \u6587\u4ef6\u3002<\/li>\n<li>\u5c07\u4e0b\u8f09\u7684\u6587\u4ef6\u89e3\u58d3\u7e2e\u5230\u4e00\u500b\u76ee\u9304\uff0c\u4f8b\u5982 <code>C:php<\/code>\u3002<\/li>\n<li>\u5728 Apache \u7684\u5b89\u88dd\u76ee\u9304\u4e2d\u627e\u5230 <code>httpd.conf<\/code> \u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u65bc <code>C:Program FilesApache GroupApache2conf<\/code>\u3002<\/li>\n<\/ul>\n<p>\u5728 <code>httpd.conf<\/code> \u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\u4ee5\u52a0\u8f09 PHP \u6a21\u7d44\uff1a<\/p>\n<pre><code>LoadModule php_module \"C:\/php\/php7apache2_4.dll\"\nAddType application\/x-httpd-php .php\nPHPIniDir \"C:\/php\"\n<\/code><\/pre>\n<p>\u78ba\u4fdd\u5c07\u8def\u5f91\u66ff\u63db\u70ba\u60a8\u5be6\u969b\u7684 PHP \u5b89\u88dd\u8def\u5f91\u3002\u7136\u5f8c\uff0c\u5c07 <code>php.ini-development<\/code> \u6587\u4ef6\u91cd\u547d\u540d\u70ba <code>php.ini<\/code>\uff0c\u4e26\u6839\u64da\u9700\u8981\u9032\u884c\u914d\u7f6e\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-mysql-LcIAFYxlmR\">\u6b65\u9a5f\u4e09\uff1a\u4e0b\u8f09\u548c\u5b89\u88dd MySQL<\/h2>\n<p>\u6700\u5f8c\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd MySQL\u3002\u53ef\u4ee5\u5f9e MySQL \u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\" rel=\"nofollow noopener\" target=\"_blank\">dev.mysql.com<\/a>\uff09\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 MySQL\u3002<\/p>\n<ul>\n<li>\u9078\u64c7 Windows \u7248\u672c\uff0c\u4e26\u4e0b\u8f09\u5b89\u88dd\u7a0b\u5e8f\u3002<\/li>\n<li>\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\uff0c\u4e26\u6309\u7167\u63d0\u793a\u9032\u884c\u5b89\u88dd\u3002<\/li>\n<li>\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e root \u5bc6\u78bc\uff0c\u8acb\u52d9\u5fc5\u8a18\u4f4f\u9019\u500b\u5bc6\u78bc\u3002<\/li>\n<\/ul>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 MySQL Workbench \u6216\u547d\u4ee4\u884c\u5de5\u5177\u4f86\u7ba1\u7406\u60a8\u7684\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%9b%9b%ef%bc%9a%e6%b8%ac%e8%a9%a6%e7%92%b0%e5%a2%83-LcIAFYxlmR\">\u6b65\u9a5f\u56db\uff1a\u6e2c\u8a66\u74b0\u5883<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fdd\u4e00\u5207\u6b63\u5e38\u904b\u884c\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684 PHP \u6e2c\u8a66\u6587\u4ef6\u3002\u5728 Apache \u7684\u6839\u76ee\u9304\uff08\u901a\u5e38\u662f <code>C:Program FilesApache GroupApache2htdocs<\/code>\uff09\u4e2d\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\u60a8\u80fd\u770b\u5230 PHP \u7684\u914d\u7f6e\u4fe1\u606f\u9801\u9762\uff0c\u5247\u8868\u793a PHP \u5df2\u6210\u529f\u5b89\u88dd\u4e26\u8207 Apache \u96c6\u6210\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-LcIAFYxlmR\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5728 Windows \u7cfb\u7d71\u4e0b\u914d\u7f6e\u4e86 Apache\u3001PHP \u548c MySQL \u74b0\u5883\u3002\u9019\u500b\u74b0\u5883\u4e0d\u50c5\u9069\u5408\u958b\u767c\u548c\u6e2c\u8a66\uff0c\u9084\u53ef\u4ee5\u7528\u65bc\u5c0f\u578b\u7db2\u7ad9\u7684\u904b\u884c\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u642d\u5efa\u60a8\u7684\u4f3a\u670d\u5668\u74b0\u5883\uff0c\u4eab\u53d7\u66f4\u7a69\u5b9a\u7684\u6027\u80fd\u548c\u66f4\u9ad8\u7684\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Windows \u4e0a\u914d\u7f6e Apache\u3001PHP \u548c MySQL \u74b0\u5883\uff0c\u5feb\u901f\u642d\u5efa\u9ad8\u6548\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-54293","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54293","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=54293"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54293\/revisions"}],"predecessor-version":[{"id":54294,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54293\/revisions\/54294"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}