{"id":123,"date":"2015-12-09T16:37:20","date_gmt":"2015-12-09T08:37:20","guid":{"rendered":"http:\/\/www.prayerlaputa.com\/?p=123"},"modified":"2015-12-09T16:37:20","modified_gmt":"2015-12-09T08:37:20","slug":"win7%e4%b8%8b%e9%85%8d%e7%bd%aephpapachemysql%e3%80%90%e8%bd%ac%e8%bd%bd-%e8%a1%a5%e5%85%85%e3%80%91","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=123","title":{"rendered":"win7\u4e0b\u914d\u7f6ePHP+apache+mysql\u3010\u8f6c\u8f7d + \u8865\u5145\u3011"},"content":{"rendered":"<p>\u672c\u5e16\u53c2\u8003\u4e86\u5982\u4e0b\u5e16\u5b50\uff1a<br \/>\nhttp:\/\/apachewin7.jiaogen.com\/2010\/04\/21\/win7%E4%B8%8Bphp5-3apache2-2%E9%85%8D%E7%BD%AE\/<br \/>\nhttp:\/\/www.umgr.com\/Blog\/PostView.aspx?bpId=67938<br \/>\nhttp:\/\/www.cnblogs.com\/good_hans\/archive\/2010\/04\/01\/1702059.html<br \/>\n\uff081\uff09\u5b89\u88c5\u5e76\u914d\u7f6eApache\uff08\u5b89\u88c5\u5230D:\\MyPrograms\\Apache\uff09<br \/>\n\u5b89\u88c5\u65f6\u9ed8\u8ba4\u5b89\u88c5\uff0cNetwork Domain, Server Name \u5982\u679c\u6ca1\u6709\u7684\u8bdd\u53ef\u4ee5\u4f7f\u7528localhost\uff0cAdministrator\u2019s Email Address\u533a\u57df\u586b\u4f60\u7684\u90ae\u4ef6\u5730\u5740\u3002\u4ee5\u540e\u53ef\u4ee5\u5728httpd.conf\u6587\u4ef6\u4e2d\u4fee\u6539\u8fd9\u4e9b\u4fe1\u606f\u3002<br \/>\nApache\u542f\u52a8\u540e\uff0c\u7528http:\/\/localhost\/\u6216http:\/\/127.0.0.1\u6d4b\u8bd5\u662f\u5426\u6210\u529f\u3002\u6210\u529f\u7684\u8bdd\u5c4f\u5e55\u4f1a\u6709\u4e2aIt works!<!--more--><br \/>\n\u6709\u5173Apache\u7684\u914d\u7f6e\u89c1\u4e0b\u9762\u5185\u5bb9\u3002<span id=\"more-142\"><\/span><br \/>\n\uff082\uff09\u914d\u7f6ePHP\uff08\u89e3\u538bPHP\u538b\u7f29\u5305\u5230D:\\MyPrograms\\php\\\uff09<br \/>\n\u9996\u5148\uff0c\u5bf9\u4e8ePHP\u7248\u672c\u7684\u8bf4\u660e\uff1a PHP\u7248\u672c\uff1aphp-5.3.2-Win32-VC6-x86\uff0cVC9\u662f\u4e13\u95e8\u4e3aIIS\u5b9a\u5236\u7684\uff0cVC6 \u662f\u4e3a\u4e86\u5176\u4ed6WEB\u670d\u52a1\u8f6f\u4ef6\u63d0\u4f9b\u7684\uff0c\u5982 Apache\u3002<br \/>\n\u5c06PHP\u89e3\u538b\u5230\u4e00\u4e2a\u975e\u4e2d\u6587\u4e14\u4e0d\u5e26\u7a7a\u683c\u7684\u8def\u5f84\u4e0b\uff08\u6211\u7528\u7684\u662fD:\\MyPrograms\\php\\\uff09\uff0c\u8be6\u7ec6\u7684\u5b89\u88c5\u6b65\u9aa4\u5728\u5b89\u88c5\u6587\u6863install.txt\u6587\u4ef6\u4e2d\uff0c\u7531\u4e8e\u662f\u5168E\u6587\u7684\u800c\u4e14\u975e\u5e38\u8be6\u7ec6\uff0c\u4f30\u8ba1\u5f88\u591a\u4eba\u4e0d\u592a\u6709\u8010\u5fc3\u5c06\u5176\u770b\u5b8c\uff0c\u4f46\u662f\u5b83\u771f\u7684\u5f88\u6709\u7528\uff0c\u672c\u6587\u540e\u9762\u4f1a\u62ff\u5176\u505a\u53c2\u8003\u3002<br \/>\nIf you are installing PHP 5, extract to C:\\php as the zip file doesn\u2019t expand as in PHP 4. You may choose a different location but do not have spaces in the path (like C:\\Program Files\\PHP) as some web servers will crash if you do.<br \/>\n\u6240\u4ee5\u8bf7\u518d\u6b21\u786e\u8ba4\u89e3\u538b\u8def\u5f84\u4e0d\u5305\u542b\u7a7a\u683c\u3002<br \/>\n\u6839\u636e\u7f51\u4e0a\u548c\u5927\u591a\u6570\u6559\u6750\u7684\u8bf4\u6cd5\u9700\u8981\u5c06\u6240\u6709\u7684dll\u6587\u4ef6\u590d\u5236\u5230\u7cfb\u7edf\u6587\u4ef6\u5939\uff08%systemroot%\\system32\uff09\uff0c\u6211\u4e2a\u4eba\u4e0d\u662f\u5f88\u559c\u6b22\u8fd9\u4e2a\u505a\u6cd5\u3002\u5728install.txt\u4e2d\u6709\u8fd9\u4e48\u4e00\u6bb5\u63cf\u8ff0\uff1a<br \/>\nTo make php5ts.dll available you have three options: copy the file to the Windows system directory, copy the file to the web server\u2019s directory, or add your PHP directory, C:\\php to the PATH. For better maintenance, we advise you to follow the last option, add C:\\php to the PATH, because it will be simpler to upgrade PHP in the future. Read more about how to add your PHP directory to PATH in the corresponding FAQ entry (and then don\u2019t forget to restart the computer \u2013 logoff isn\u2019t enough).<br \/>\n\u6240\u4ee5\u4e3a\u4e86\u4eca\u540e\u5347\u7ea7\u548c\u7ef4\u62a4\u7684\u65b9\u4fbf\uff0c\u6700\u597d\u7684\u65b9\u6cd5\u662f\u5c06PHP\u7684\u89e3\u538b\u8def\u5f84\uff08\u5982D:\\MyPrograms\\php\\\uff09\u52a0\u5165PATH\u73af\u5883\u53d8\u91cf\uff0c\u7136\u540ereboot\u3002<br \/>\nPHP\u5728\u89e3\u538b\u8def\u5f84\u5b58\u653e\u6709\u4e24\u4e2a\u6587\u4ef6 php.ini-development \u548c php.ini-production\uff0c\u867d\u7136install.txt\u5f3a\u70c8\u5efa\u8bae\u6807\u51c6\u670d\u52a1\u5668\u4f7f\u7528\u540e\u8005\uff0c\u4f46\u662f\u5bf9\u4e8e\u5f00\u53d1\u800c\u8a00\u8fd8\u662f\u9002\u5408\u4f7f\u7528php.ini- development\uff0c\u5c06\u5176\u5907\u4efd\u540e\u6539\u540d\u4e3aphp.ini\uff0c\u7528\u6587\u672c\u7f16\u8f91\u5668\u5c06\u5176\u6253\u5f00\u3002<br \/>\n\u9996\u5148\u67e5\u627eextension_dir\uff0c\u5b83\u7528\u4e8e\u6307\u5b9aPHP\u6269\u5c55dll\u7684\u4f4d\u7f6e\uff0c\u6839\u636e\u6ce8\u91ca\u53ef\u4ee5\u5c06On windows\u4e0b\u7684\u90a3\u4e00\u884c\u6539\u6210<br \/>\nextension_dir = \u201cD:\\MyPrograms\\php\\ext\u201d<br \/>\n\u7136\u540e\u67e5\u627edoc_root\uff0c\u5b83\u7528\u4e8e\u6307\u5b9aWeb\u670d\u52a1\u5668\u7684\u6839\u8def\u5f84\uff0c \u5c06\u5176\u6539\u6210<br \/>\ndoc_root = \u201cD:\\MyPrograms\\php\\Apache\\htdocs\u201d ; \u5982\u679c\u4e4b\u540e\u8981\u6539\u53d8\u6839\u8def\u5f84\u5219\u53ef\u4ee5\u586b\u5165\u65b0\u7684\u6839\u8def\u5f84<br \/>\n\u4e4b\u540e\u9009\u62e9\u8fd0\u884c\u4e00\u4e9bPHP\u5fc5\u987b\u7684\u6269\u5c55\uff0c\u67e5\u627eextension\uff0c\u5c06\u4e0b\u9762\u51e0\u4e2aextension\u524d\u7684\u6ce8\u91ca\u5206\u53f7\u53bb\u6389<br \/>\nextension=php_gd2.dll<br \/>\nextension=php_imap.dll<br \/>\nextension=php_mysql.dll ; \u4f7f\u7528MySQL\u5fc5\u9700<br \/>\nextension=php_mysqli.dll ; \u4f7f\u7528MySQL\u5fc5\u9700<br \/>\n\u7136\u540e\u4fdd\u5b58\uff0c\u5173\u95edphp.ini\u3002<br \/>\n==== \u914d\u7f6e Apache ====<br \/>\n\u9996\u5148\u68c0\u67e5PHP\u89e3\u538b\u8def\u5f84\u4e0b\u6709\u6ca1\u6709\u4e00\u4e2aphp5apache2_2.dll\u6587\u4ef6\uff08\u5982\u679c\u6ca1\u6709\u5219\u8868\u660e\u4f60\u9009\u9519\u4e86php\u538b\u7f29\u5305\u7684\u7248\u672c\uff09\uff0c\u7136\u540e\u5728Apache\u7684\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684conf\u76ee\u5f55\u4e2d\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00httpd.conf\u6587\u4ef6\uff0c\u67e5\u627e\u4e00\u4e0bLoadModule\u4e0b\u662f\u5426\u5df2\u7ecf\u6709\u4e0b\u9762\u7684 \u51e0\u53e5\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u5728\u6240\u6709LoadModule\u7684\u4e0b\u9762\u52a0\u5165\u4ee5\u4e0b\u51e0\u53e5<br \/>\nLoadModule php5_module D:\/MyPrograms\/PHP\/php5apache2_2.dll # \u8f7d\u5165php\u6a21\u5757<br \/>\nPHPIniDir \u201cD:\/MyPrograms\/PHP\u201d # \u6307\u5b9aphp.ini\u7684\u8def\u5f84<br \/>\nAddType application\/x-httpd-php .php # \u5141\u8bb8php\u8bed\u6cd5\u5728.php\u6587\u4ef6\u4e2d\u4f7f\u7528<br \/>\nAddType application\/x-httpd-php .html # \u5141\u8bb8php\u8bed\u6cd5\u5728.html\u6587\u4ef6\u4e2d\u4f7f\u7528\uff0c\u6b64\u5904\uff0c\u201c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6269\u5c55\u540d\uff0c\u6709\u4e9b\u7528\u6237\u4f7f\u7528PHP\u65f6\u559c\u6b22\u7528.html\u6269\u5c55\u540d\uff0c\u8981\u8bb0\u4f4f\uff0c\u8fd9\u6837\u6700\u7ec8\u4f1a\u5bfc\u81f4\u4e00\u4e2a\u540e\u679c\uff0c\u6bcf\u6b21\u8bf7\u6c42HTML\u6587\u4ef6\u65f6\u90fd\u4f1a\u628a\u6587\u4ef6\u4ea4\u7531PHP\u89e3\u6790\u3002\u201c\uff08\u5f15\u81ea\u300aPHP\u4e0eMySQL5\u7a0b\u5e8f\u8bbe\u8ba1\u300b\uff09\uff0c\u56e0\u6b64\u4e0d\u5efa\u8bae\u628a\u8fd9\u53e5\u4e5f\u52a0\u4e0a\u3002<br \/>\n\uff08\u4ee5\u4e0a#\u548c\u540e\u9762\u7684\u63d0\u793a\u6709\u65f6\u5019\u4f1a\u5f15\u8d77apache\u670d\u52a1\u4e0d\u80fd\u542f\u52a8\u7684\u95ee\u9898\uff0c\u6700\u597d\u5427\u6ce8\u91ca\u53bb\u6389\u3002\uff09<br \/>\n\u5982\u679c\u9700\u8981\u6539\u53d8Web\u6839\u8def\u5f84\uff0c\u53ef\u4ee5\u67e5\u627eDocumentRoot\uff0c\u5c06\u76f8\u5173\u884c\u4fee\u6539\uff1a<br \/>\nDocumentRoot \u201cD:\/MyPrograms\/Apache\/htdocs\u201d<br \/>\n\u540c\u65f6\u5fc5\u987b\u5728\u4ee5\u4e0b\u5730\u65b9\u8fdb\u884c\u76f8\u5e94\u4fee\u6539\uff1a<br \/>\n\u63a5\u4e0b\u67e5\u627eDirectoryIndex\uff0c\u6b64\u5904\u7528\u4e8e\u6307\u5b9aurl\u4e3a\u4e00\u76ee\u5f55\u65f6\u9ed8\u8ba4\u8f7d\u5165\u6587\u4ef6\u7684\u987a\u5e8f\uff0c\u901a\u5e38\u4e3aindex.php,index.html, \u7b49\u7b49\uff0c\u9488\u5bf9php\u53ef\u4ee5\u91c7\u7528\u5982\u4e0b\u7684\u8bbe\u7f6e\uff1a<br \/>\nDirectoryIndex index.php index.html default.php default.html<br \/>\n\u6ce8\u610f\u6587\u4ef6\u540d\u7684\u4e2d\u95f4\u7528\u7a7a\u683c\u9694\u5f00\u3002<br \/>\n\u5982\u679c\u9700\u8981\u4fee\u6539\u7aef\u53e3\uff0c\u67e5\u627elisten \u4fee\u6539\u540e\u8fb9\u7684\u6570\u503c<br \/>\n\u4fdd\u5b58\u5e76\u5173\u95edhttpd.conf\uff0c\u53cc\u51fbApache\u7684\u6258\u76d8\u56fe\u6807\u6253\u5f00\u754c\u9762\uff0c\u70b9\u51fbRestart\u91cd\u542fApache\u3002<br \/>\n\u4e4b\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u6d4b\u8bd5PHP\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\u4e86\uff0c\u5728Web\u6839\u8def\u5f84\uff08\u9ed8\u8ba4\u4e3aApache\u5b89\u88c5\u76ee\u5f55\u7684htdocs\uff09\u4e0b\u65b0\u5efa\u4e00\u4e2atest.php\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4e00\u884c\u5185\u5bb9<br \/>\n\u4fdd\u5b58\u9000\u51fa\u3002\u5728\u6d4f\u89c8\u5668\u8f93\u5165http:\/\/localhost\/test.php\uff0c\u5982\u679c\u6709\u8be6\u7ec6php\u7684\u914d\u7f6e\u4fe1\u606f\u663e\u793a\uff0c\u8bf4\u660e\u914d\u7f6e\u6210\u529f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5e16\u53c2\u8003\u4e86\u5982\u4e0b\u5e16\u5b50\uff1a http:\/\/apachewin7.jiaogen.com\/2010\/04\/21\/win <a href='http:\/\/prayerlaputa.com\/?p=123' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[14,25],"tags":[46,57],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/123"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=123"}],"version-history":[{"count":0,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/123\/revisions"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}