{"id":673,"date":"2013-11-28T23:27:42","date_gmt":"2013-11-28T07:27:42","guid":{"rendered":"http:\/\/www.yclimw.com\/?p=673"},"modified":"2021-05-31T14:08:14","modified_gmt":"2021-05-31T06:08:14","slug":"ee52b4be21de99cfb15112ca6cf52d98","status":"publish","type":"post","link":"https:\/\/www.yclimw.com\/?p=673","title":{"rendered":"PHP5+APACHE2.2\u914d\u7f6e"},"content":{"rendered":"<div style=\"background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-size: auto; border: 0px none rgb(0, 0, 0); color: rgb(0, 0, 0); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px; background-position: 0% 0%; background-repeat: repeat repeat;\">\n<p>\u4ee5\u4e0b\u4e3a\u8f6c\u5e16\u5185\u5bb9\uff1a<\/p>\n<p>\u539f\u6587\u51fa\u5904\uff1a<a href=\"http:\/\/hi.baidu.com\/oyej\/blog\/item\/d5b934344497d23a5bb5f5c5.html#send\">http:\/\/hi.baidu.com\/oyej\/blog\/item\/d5b934344497d23a5bb5f5c5.html#send<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>PHP5+APACHE2.2\u914d\u7f6e\u6210\u529f\u6848\u4f8b\uff1a<br \/>\u7b2c\u4e00\u3001\u5b89\u88c5\u5e76\u914d\u7f6eAPACHE\uff08\u4ee5\u6211\u7684\u4e3a\u4f8b\uff0c\u5b89\u88c5\u5230E:\\Program Files\\Apache Software Foundation\\Apache2.2\uff09<br \/>1\u3001\u5b89\u88c5\u65f6\u9ed8\u8ba4\u5b89\u88c5\uff0cNetwork Domain, Server Name \u6211\u586b\u5199\u6211\u7684\u8ba1\u7b97\u673a\u540d\uff0cAdministrator&#8217;s Email Address\u533a\u57df\u586b\u4f60\u7684\u90ae\u4ef6\u5730\u5740<br \/>2\u3001\u5b89\u88c5\u5b8c\u540e\u5728\u5b89\u88c5\u76ee\u5f55\u4e0b\u6709\u4e2aconf\u6587\u4ef6\u5939\uff0c\u6253\u5f00httpd.conf\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e<br \/>\u00b7\u627e\u5230 DocumentRoot \uff0c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u4f60\u6240\u8981\u5b58\u653ephp, htm\u7b49\u7f51\u9875\u6587\u4ef6\u7684\u6587\u4ef6\u5939\uff0c\u5982 &#8220;E:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs&#8221;\uff1b<br \/>\u00b7\u627e\u5230 DirectoryIndex \uff0c\u5728index.html\u540e\u6dfb\u52a0index.php, index.htm\u7b49\uff0c\u4ee5\u5355\u4e2a\u7a7a\u683c\u5c06\u5176\u5206\u5f00\uff1b<br \/>\u00b7\u91cd\u542fApache\uff0c\u7528<a href=\"http:\/\/localhost\/\">http:\/\/localhost\/<\/a>\u6216<a href=\"http:\/\/127.0.0.1\/\">http:\/\/127.0.0.1\/<\/a>\u6216<a href=\"http:\/\/yourcompanyname\/\">http:\/\/yourcompanyname\/<\/a>\u6d4b\u8bd5\u662f\u5426\u6210\u529f\u3002\u6210\u529f\u7684\u8bdd\u5c4f\u5e55\u4f1a\u6709\u4e2aIt works!<br \/>\u7b2c\u4e8c\u3001\u5b89\u88c5\u914d\u7f6ePHP\uff08\u89e3\u538bPHP\u538b\u7f29\u5305\u5230d:\\php\\\uff09<br \/>1\u3001\u5c06php.ini-recommended\u6587\u4ef6\u91cd\u547d\u540d\u4e3aphp.ini\u5e76\u5c06\u5176\u526a\u5230\u7cfb\u7edf\u6240\u5728\u76ee\u5f55\u4e0b(\u5982\u653e\u57282000\/NT\u7684WINNT\/system32, XP\u7684Windows\/system32\u76ee\u5f55\u4e0b),<br \/>2\u3001\u5c06extension_dir \u6539\u4e3aphp\/ext\u6240\u5728\u76ee\u5f55\uff0c\u5982 &#8220;d:\\php\\ext&#8221;\uff1b<br \/>3\u3001\u5c06doc_root \u6539\u4e3a\u7b2c\u4e00\u6b65\u4e2d\u7684\u540c\u6837\u76ee\u5f55\uff0c\u5982 &#8220;E:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs&#8221;\uff1b<br \/>4\u3001\u627e\u5230 ;session.save_path = &#8220;\/tmp&#8221; ,\u5c06&#8217;;&#8217;\u53bb\u6389,\u8bbe\u7f6e\u4f60\u4fdd\u5b58session\u7684\u76ee\u5f55\uff0c\u5982session.save_path = &#8220;D:\/php\/session_temp&#8221;\uff1b<br \/>5\u3001\u7136\u540e\u628a\u4e0b\u9762\u51e0\u53e5\u524d\u9762\u7684\u5206\u53f7\u53bb\u6389,\u4ee5\u66f4\u597d\u652f\u6301Mysql and PHPmyadmin <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extension=php_mbstring.dll<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extension=php_gd2.dll<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extension=php_mysql.dll<br \/>\u7b2c\u4e09\u3001PHP+APACHE<br \/>1\u3001\u5141\u8bb8Apache\u5c06PHP\u7a0b\u5e8f\u4f5c\u4e3a\u6a21\u5757\u6765\u8fd0\u884c:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u6253\u5f00httpd.conf,\u6dfb\u52a0\u4e0b\u9762\u5185\u5bb9(\u4f4d\u7f6e\u4efb\u610f)\uff1a<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LoadModule php5_module &#8220;d:\/php\/php5apache2_2.dll&#8221;(\u7279\u522b\u6ce8\u610f\u8fd9\u4e00\u6761\uff0c\u5f88\u591a\u5730\u65b9\u662f\u8c03\u7528php5apache2.dll\uff0c\u8fd9\u6837\u5728\u8fd0\u884cPHP\u4ee3\u7801\u65f6\u4f1a\u63d0\u793ahttpd.exe\u5e94\u7528\u7a0b\u5e8f\u9519\u8bef)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddType application\/x-httpd-php .php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddType application\/x-httpd-php .htm<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \uff08.htm, .php\u4e3a\u53ef\u6267\u884cphp\u8bed\u8a00\u7684\u6269\u5c55\u540d\uff0c\u4e5f\u53ef\u52a0html, php3, php4,\u751a\u81f3txt\uff09<br \/>\uff08\u4ee5\u4e0b\u4e24\u6b65\u53ef\u4ee5\u4e0d\u9700\u8981\uff09<br \/>2\u3001\u5982\u679c\u4f60\u51fa\u4e8e\u67d0\u79cd\u539f\u56e0\u800c\u9700\u8981\u5728CGI\u6a21\u5f0f\u4e2d\u8fd0\u884cPHP\u7a0b\u5e8f\uff08\u4f7f\u7528Php.exe\uff09\uff0c<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u8bf7\u5c06\u4e0a\u9762\u8fd9\u4e00\u884c\u53d8\u6210\u6ce8\u91ca\uff08\u5404\u884c\u5934\u52a0#\u5373\u53ef\uff09\uff0c\u6dfb\u52a0\u4e0b\u9762\u8fd9\u4e9b\u884c\uff1a <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp; ScriptAlias \/php\/ &#8220;d:\/php\/&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # AddType application\/x-httpd-php .php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Action application\/x-httpd-php &#8220;\/php\/php-cgi.exe&#8221;<br \/>3\u3001\u73b0\u5728apache 2 \u652f\u6301HTML\u800c\u4e0d\u652f\u6301PHP,\u5148\u628a\u4e0b\u9762\u51e0\u53e5\u52a0\u5230d:\\apache2\\conf\\httpd.conf\u53bb:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ScriptAlias \/php\/ &#8220;d:\/php\/&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # AddType application\/x-httpd-php .php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Action application\/x-httpd-php &#8220;\/php\/php-cgi.exe&#8221;<br \/>&nbsp;&nbsp;&nbsp;<br \/>\u7b2c\u56db\u3001\u91cd\u8d77\u670d\u52a1<br \/>1\u3001\u5728d:\\PHP\u91cc\u627e\u5230php5ts.dll,libmysql.dll\u5c06\u5176\u590d\u5236\u5230c:\\winnt\\system32\u4e0b(winNT\/2000\u7684\u673a\u5668),\u800cwinXP\/2003\u662f\u590d\u5236\u5230c:\\windows\\system32\u4e0b<br \/>2\u3001\u6d4b\u8bd5Apache\u4e0ephp\u662f\u5426\u8fde\u63a5\u6210\u529f\uff1a<br \/>&nbsp;&nbsp;&nbsp;&nbsp; \u542f\u52a8start apache\u670d\u52a1\u6216\u8005\u6b63\u5728\u8fd0\u884c\u7684\u5c31\u91cd\u65b0\u542f\u52a8restart apache<br \/>3\u3001\u5728Web\u6839\u76ee\u5f55\u4e0b\u65b0\u5efatest.php\uff08\u5373E:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\u76ee\u4e0b\uff09<br \/>&lt;html&gt;<br \/>&lt;head&gt;&lt;title&gt;test&lt;\/title&gt;&lt;\/head&gt;<br \/>&lt;body&gt;<br \/>&lt;?php<br \/>phpinfo();<br \/>?&gt; <br \/>&lt;\/body&gt;<br \/>&lt;\/html&gt;<\/p>\n<p>4\u3001\u8fd0\u884c<a href=\"http:\/\/localhost\/test.php\"><font color=\"#800080\">http:\/\/localhost\/test.php<\/font><\/a><br \/>\u5982\u679c\u6210\u529f\uff0c\u5219\u5e94\u8be5\u770b\u5230\u4e00\u4e2a\u542b\u6709PHP\u5fbd\u6807\u7684\u7f51\u9875\uff0c\u5176\u4e2d\u5305\u542b\u5927\u91cf\u8bbe\u7f6e\u548c\u5176\u4ed6\u4fe1\u606f<br \/>\u90a3\u4e48\u606d\u559c\u4f60<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u4e3a\u8f6c\u5e16\u5185\u5bb9\uff1a \u539f\u6587\u51fa\u5904\uff1ahttp:\/\/hi.baidu.com\/oyej\/blog\/item\/d5b934 &hellip; <a href=\"https:\/\/www.yclimw.com\/?p=673\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">PHP5+APACHE2.2\u914d\u7f6e<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-673","post","type-post","status-publish","format-standard","hentry","category-17"],"_links":{"self":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=673"}],"version-history":[{"count":2,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions"}],"predecessor-version":[{"id":3078,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions\/3078"}],"wp:attachment":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}