{"id":43,"date":"2023-06-05T13:28:46","date_gmt":"2023-06-05T05:28:46","guid":{"rendered":"http:\/\/pro369.com\/php\/?p=43"},"modified":"2019-04-29T00:14:00","modified_gmt":"2019-04-29T00:14:00","slug":"%e8%ae%93php%e8%b7%91%e5%9c%a8mac-os-x%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/por.tw\/php\/%e8%ae%93php%e8%b7%91%e5%9c%a8mac-os-x%e4%b8%ad\/","title":{"rendered":"\u8b93PHP\u8dd1\u5728Mac OS X\u4e2d"},"content":{"rendered":"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"content\" align=\"center\" style=\"table-layout: fixed; word-wrap: break-word\">\n<tr>\n<td id=\"read_tpc\" class=\"content_word\" align=\"left\"><font face=\"\u7d30\u660e\u9ad4\" id=\"zoom\"><span> <\/p>\n<p><font color=\"#008000\"><strong>MacBook\u5165\u624b\u4e86\uff0c\u914d\u7f6e\u5de5\u4f5c\u74b0\u5883\uff0c\u9996\u5148\u5f97\u8b93Mac OS\u652f\u63f4PHP\u3002\u4e0d\u7ba1\u4f60\u662f\u63a1\u7528\u6574\u5408\u7684\u958b\u767c\u74b0\u5883\uff0c\u6bd4\u5982XAMPP for Mac OS X\uff0c\u9084\u662f\u63a1\u7528Mac OS\u4e2d\u81ea\u5e36\u7684Apache\u548cPHP\uff0c\u751a\u81f3\u81ea\u5df1\u91cd\u65b0\u7de8\u8b6f\u5b89\u88dd\uff0c\u6e1b\u5c11\u9ebb\u7169\u7684\u7b2c\u4e00\u6b65\u5c31\u662f\u555f\u7528root\u4f7f\u7528\u8005\u3002<\/strong><\/font><\/p>\n<p> <\/p>\n<p><font color=\"#0000FF\"><strong>\u672c\u6587\u91c7\u7528\u7684\u6a21\u5f0f\u662f\u4f7f\u7528Mac OS X 10.5.6\u81ea\u5e36\u7684Apache\u548cPHP\uff0c\u5b89\u88ddMySQL\u7684dmg\u7248\u672c\uff0c\u4ee5\u4e0b\u64cd\u4f5c\u975e\u7279\u6b8a\u8aaa\u660e\u5747\u4ee5root\u4f7f\u7528\u8005\u5728\u6307\u4ee4\u884c\u4e0b\u9032\u884c\u3002<\/strong><\/font><\/p>\n<p> <\/p>\n<p><strong>\u555f\u7528root\u4f7f\u7528\u8005<\/strong><br \/> 1.\u958b\u555f\u300c\u76ee\u9304\u5be6\u7528\u5de5\u5177\u300d\uff0c\u5b83\u4f4d\u65bc\u300c\u61c9\u7528\u7a0b\u5f0f\u300d\u8cc7\u6599\u593e\u7684\u300c\u5be6\u7528\u5de5\u5177\u300d\u8cc7\u6599\u593e\u4e2d\u3002<br \/> 2.\u9ede\u6309\u9396\u5716\u793a\u4ee5\u9032\u884c\u8b8a\u66f4\u3002\u60a8\u5c07\u9700\u8981\u8f38\u5165\u7ba1\u7406\u54e1\u540d\u7a31\u548c\u5bc6\u78bc\u3002<br \/> 3.\u9078\u53d6\u300c\u7de8\u8f2f\u300d&gt;\u300c\u555f\u7528 Root \u4f7f\u7528\u8005\u300d\u3002<br \/> 4.\u70ba root \u4f7f\u7528\u8005\u8f38\u5165\u5b89\u5168\u5bc6\u78bc\uff0c\u7136\u5f8c\u5728\u300c\u9a57\u8b49\u300d\u6b04\u518d\u6b21\u8f38\u5165\u5b83\uff0c\u6700\u5f8c\u9ede\u6309\u300c\u597d\u300d\u3002<\/p>\n<p> <\/p>\n<p><strong>\u555f\u7528Apache<\/strong><br \/> Mac OS X 10.5.6\u81ea\u5e36\u4e86Apache 2.2.9\uff0c\u76f4\u63a5\u5728\u6307\u4ee4\u884c\u904b\u884c<span style=\"background-color: #cccccc\">apachectl start<\/span>\uff0cApache\u5c31\u641e\u5b9a\u4e86\u3002<\/p>\n<p> <\/p>\n<p>\u73fe\u5728Apache\u7684\u4e3b\u76ee\u9304\u5c31\u662f\/Libary\/WebServer\/Documents\/\uff0c\u4f60\u53ef\u4ee5\u5728\u9019\u76ee\u9304\u88e1\u653e\u7f6e\u6a94\u6848\u6e2c\u8a66\u4e86\u3002<\/p>\n<p> <\/p>\n<p><strong>\u555f\u7528PHP<\/strong><br \/> Mac OS X 10.5.6\u81ea\u5e36\u4e86PHP 5.2.6\uff0c\u6211\u5011\u9700\u8981\u505a\u7684\u5c31\u662f\u5c07PHP\u52a0\u5165Apache\u4e2d\u3002<\/p>\n<p> <\/p>\n<p>\u4fee\u6539\/etc\/apache2\/httpd.conf\u4e2d\u7684<br \/> <span style=\"background-color: #cccccc\">#loadModule php5_module libexec\/apache2\/libphp5.so<\/span><br \/> \u70ba<br \/> <span style=\"background-color: #cccccc\">loadModule php5_module libexec\/apache2\/libphp5.so<\/span><\/p>\n<p> <\/p>\n<p>\u7136\u5f8c\u5c07\/etc\/php.ini.default\u8907\u88fd\u70ba\/etc\/php.ini\u3002<br \/> <span style=\"background-color: #cccccc\">cp \/etc\/php.ini.default \/etc\/php.ini<\/span><\/p>\n<p> <\/p>\n<p>\u4e4b\u5f8c\u5c31\u53ef\u4ee5\u6309\u7167\u81ea\u5df1\u7684\u7fd2\u6163\u4fee\u6539php.ini\u7684\u914d\u7f6e<br \/> \u6bd4\u5982\u5c07<span style=\"background-color: #cccccc\">error_reporting = E_ALL &amp; ~E_NOTICE<\/span><br \/> \u4fee\u6539\u70ba<br \/> <span style=\"background-color: #cccccc\">error_reporting = E_ALL<\/span><\/p>\n<p> <\/p>\n<p>\u6700\u5f8c\uff0c\u91cd\u555fApache\uff0c\u53ef\u4ee5\u5728\/Libary\/WebServer\/Documents\/\u76ee\u9304\u4e2d\u5efa\u7acb\u500bphpinfo.php\u4f86\u6e2c\u8a66\u4e86\u3002<br \/> <span style=\"background-color: #cccccc\">apachectl restart<\/span><\/p>\n<p> <\/span><\/font><\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>MacBook\u5165\u624b\u4e86\uff0c\u914d\u7f6e\u5de5\u4f5c\u74b0\u5883\uff0c\u9996\u5148\u5f97\u8b93Mac OS\u652f\u63f4PHP\u3002\u4e0d\u7ba1\u4f60\u662f\u63a1\u7528\u6574\u5408\u7684\u958b\u767c\u74b0\u5883\uff0c\u6bd4\u5982XAMPP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":381,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[22],"class_list":["post-43","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/43"}],"collection":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media\/381"}],"wp:attachment":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}