{"id":54351,"date":"2024-10-09T18:40:18","date_gmt":"2024-10-09T10:40:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54351\/"},"modified":"2024-10-09T18:40:19","modified_gmt":"2024-10-09T10:40:19","slug":"winxp-%e4%b8%8b-apache-php-mysql-%e5%ae%89%e8%a3%9d%e8%a8%ad%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54351\/","title":{"rendered":"WinXP \u4e0b Apache + PHP + MySQL \u5b89\u88dd\u8a2d\u7f6e\u65b9\u6cd5"},"content":{"rendered":"<h1 id=\"winxp-%e4%b8%8b-apache-php-mysql-%e5%ae%89%e8%a3%9d%e8%a8%ad%e7%bd%ae%e6%96%b9%e6%b3%95-gOFEdEHKxt\">WinXP \u4e0b Apache + PHP + MySQL \u5b89\u88dd\u8a2d\u7f6e\u65b9\u6cd5<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0cApache\u3001PHP \u548c MySQL \u662f\u69cb\u5efa\u52d5\u614b\u7db2\u7ad9\u7684\u4e09\u5927\u57fa\u77f3\u3002\u96d6\u7136 Windows XP \u662f\u4e00\u500b\u8f03\u820a\u7684\u64cd\u4f5c\u7cfb\u7d71\uff0c\u4f46\u4ecd\u7136\u6709\u8a31\u591a\u958b\u767c\u8005\u548c\u5b78\u7fd2\u8005\u4f7f\u7528\u5b83\u4f86\u9032\u884c\u672c\u5730\u958b\u767c\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 Windows XP \u4e0a\u5b89\u88dd\u548c\u914d\u7f6e Apache\u3001PHP \u548c MySQL\u3002<\/p>\n<h2 id=\"%e7%ac%ac%e4%b8%80%e6%ad%a5%ef%bc%9a%e5%ae%89%e8%a3%9d-apache-gOFEdEHKxt\">\u7b2c\u4e00\u6b65\uff1a\u5b89\u88dd Apache<\/h2>\n<p>Apache \u662f\u4e00\u500b\u958b\u6e90\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5b89\u88dd\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 Apache \u5b89\u88dd\u5305\uff1a\u8a2a\u554f <a href=\"https:\/\/httpd.apache.org\/download.cgi\" rel=\"nofollow noopener\" target=\"_blank\">Apache \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u9078\u64c7\u9069\u5408 Windows \u7684\u7248\u672c\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684\u6587\u4ef6\uff0c\u5c07\u5176\u653e\u7f6e\u5728 C:Apache \u76ee\u9304\u4e0b\u3002<\/li>\n<li>\u6253\u958b\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u9032\u5165 Apache \u7684 bin \u76ee\u9304\uff1a<\/li>\n<pre><code>cd C:Apachebin<\/code><\/pre>\n<li>\u904b\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\uff1a<\/li>\n<pre><code>httpd -k start<\/code><\/pre>\n<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost<\/code> \u4f86\u6aa2\u67e5 Apache \u662f\u5426\u904b\u884c\u6b63\u5e38\u3002\u5982\u679c\u770b\u5230 Apache \u7684\u6b61\u8fce\u9801\u9762\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%ac%ac%e4%ba%8c%e6%ad%a5%ef%bc%9a%e5%ae%89%e8%a3%9d-php-gOFEdEHKxt\">\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88dd PHP<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd PHP\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 PHP\uff1a\u8a2a\u554f <a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">PHP \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u9078\u64c7\u9069\u5408 Windows \u7684\u7248\u672c\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e PHP \u6587\u4ef6\uff0c\u5c07\u5176\u653e\u7f6e\u5728 C:PHP \u76ee\u9304\u4e0b\u3002<\/li>\n<li>\u5c07 PHP \u7684\u8def\u5f91\u6dfb\u52a0\u5230\u7cfb\u7d71\u74b0\u5883\u8b8a\u91cf\u4e2d\uff1a<\/li>\n<ul>\n<li>\u53f3\u9375\u9ede\u64ca\u201c\u6211\u7684\u96fb\u8166\u201d\uff0c\u9078\u64c7\u201c\u5c6c\u6027\u201d\u3002<\/li>\n<li>\u9078\u64c7\u201c\u9ad8\u7d1a\u201d\u9078\u9805\u5361\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u74b0\u5883\u8b8a\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7d71\u8b8a\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\uff0c\u4e26\u6dfb\u52a0 C:PHP \u5230\u8a72\u8b8a\u91cf\u7684\u672b\u5c3e\u3002<\/li>\n<\/ul>\n<li>\u914d\u7f6e Apache \u4ee5\u652f\u6301 PHP\uff1a\u6253\u958b Apache \u7684\u914d\u7f6e\u6587\u4ef6 <code>httpd.conf<\/code>\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/li>\n<pre><code>LoadModule php_module \"C:\/PHP\/php5apache2_2.dll\"<\/code><\/pre>\n<pre><code>AddType application\/x-httpd-php .php<\/code><\/pre>\n<pre><code>PHPIniDir \"C:\/PHP\"<\/code><\/pre>\n<li>\u91cd\u555f Apache \u670d\u52d9\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/li>\n<\/ol>\n<p>\u70ba\u4e86\u6e2c\u8a66 PHP \u662f\u5426\u5b89\u88dd\u6210\u529f\uff0c\u60a8\u53ef\u4ee5\u5728 C:Apachehtdocs \u76ee\u9304\u4e0b\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>info.php<\/code> \u7684\u6587\u4ef6\uff0c\u5167\u5bb9\u5982\u4e0b\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\u770b\u5230 PHP \u7684\u4fe1\u606f\u9801\u9762\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%ac%ac%e4%b8%89%e6%ad%a5%ef%bc%9a%e5%ae%89%e8%a3%9d-mysql-gOFEdEHKxt\">\u7b2c\u4e09\u6b65\uff1a\u5b89\u88dd MySQL<\/h2>\n<p>\u6700\u5f8c\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd MySQL \u6578\u64da\u5eab\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 MySQL\uff1a\u8a2a\u554f <a href=\"https:\/\/dev.mysql.com\/downloads\/mysql\/\" rel=\"nofollow noopener\" target=\"_blank\">MySQL \u5b98\u65b9\u7db2\u7ad9<\/a>\uff0c\u9078\u64c7\u9069\u5408 Windows \u7684\u7248\u672c\u3002<\/li>\n<li>\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\uff0c\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88dd\u3002<\/li>\n<li>\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e root \u7528\u6236\u7684\u5bc6\u78bc\uff0c\u8acb\u52d9\u5fc5\u8a18\u4f4f\u9019\u500b\u5bc6\u78bc\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 MySQL \u670d\u52d9\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\u9032\u884c\u64cd\u4f5c\uff1a<\/li>\n<pre><code>net start mysql<\/code><\/pre>\n<li>\u4f7f\u7528 MySQL \u5ba2\u6236\u7aef\u9023\u63a5\u5230\u6578\u64da\u5eab\uff1a<\/li>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<li>\u8f38\u5165\u60a8\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\u8a2d\u7f6e\u7684\u5bc6\u78bc\u3002<\/li>\n<\/ol>\n<h2 id=\"%e7%b8%bd%e7%b5%90-gOFEdEHKxt\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5728 Windows XP \u4e0a\u5b89\u88dd\u4e26\u914d\u7f6e\u4e86 Apache\u3001PHP \u548c MySQL\u3002\u9019\u4e09\u8005\u7684\u7d50\u5408\u70ba\u60a8\u63d0\u4f9b\u4e86\u4e00\u500b\u5f37\u5927\u7684\u672c\u5730\u958b\u767c\u74b0\u5883\uff0c\u9069\u5408\u5b78\u7fd2\u548c\u6e2c\u8a66\u5404\u7a2e\u7db2\u9801\u61c9\u7528\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u958b\u767c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u9032\u884c\u66f4\u5c08\u696d\u7684\u90e8\u7f72\u548c\u6e2c\u8a66\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8be6\u7ec6\u4ecb\u7ecd\u5728WinXP\u4e0b\u5b89\u88c5\u548c\u914d\u7f6eApache\u3001PHP\u548cMySQL\u7684\u6b65\u9aa4\uff0c\u5e2e\u52a9\u7528\u6237\u8f7b\u677e\u642d\u5efa\u672c\u5730\u5f00\u53d1\u73af\u5883\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-54351","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54351","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=54351"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54351\/revisions"}],"predecessor-version":[{"id":54352,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54351\/revisions\/54352"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}