{"id":2213,"date":"2016-05-22T10:43:46","date_gmt":"2016-05-22T02:43:46","guid":{"rendered":"http:\/\/192.168.50.160\/wordpress\/?p=2213"},"modified":"2016-05-22T10:47:06","modified_gmt":"2016-05-22T02:47:06","slug":"install-phalcon-mamp-osx","status":"publish","type":"post","link":"https:\/\/history.dowdot.idv.tw\/?p=2213","title":{"rendered":"Install Phalcon with MAMP on OSX"},"content":{"rendered":"<p>\u6700\u8fd1\u60f3\u4f86\u73a9\u73a9 Phalcon\uff0c \u4f46\u662f\u6211\u7684OSX\u662f\u5b89\u88ddMAMP\uff0c\u6240\u4ee5Phalcon\u5b98\u65b9\u91dd\u5c0dOSX\u63d0\u4f9b\u7684\u5b89\u88dd\u65b9\u6cd5\u4f3c\u4e4e\u4e0d\u592a\u7ba1\u7528\u3002<br \/>\n\u4e0a\u7db2\u67e5\u627e\u4e86\u4e00\u4e0b\uff0c\u767c\u73fe\u5fc5\u9700\u5c07MAMP\u88e1\u7684PHP\u91cd\u65b0\u518d\u7de8\u4e00\u4e0b\uff0c\u7d42\u65bc\u662f\u88dd\u8d77\u4f86\u4e86\uff0c\u6240\u4ee5\uff0c\u4f86\u8a18\u9304\u4e00\u4e0b\u5427!!<\/p>\n<p>1.\u78ba\u5b9a\u4f60MAMP\u6240\u8dd1\u7684PHP\u7248\u672c:<br \/>\n  \u9019\u90e8\u4efd\u4f60\u53ef\u4ee5\u5728MAMP\u7684console\u6216\u662f\u7528phpinfo()\u770b\u770b<br \/>\n  \u50cf\u8c46\u5b50\u65e9\u524d\u5b89\u88dd\u7684\u7248\u672c\u5c31\u662f PHP 5.5.23<\/p>\n<p>2.\u78ba\u8a8dMAMP PHP bin \u7684\u76ee\u9304\u8def\u5f91:<br \/>\n  \u4e00\u822c\u4f86\u8aaa MAMP PHP bin\u7684\u5b89\u88dd\u8def\u5f91\u6703\u662f\u5728<br \/>\n  \/Applications\/MAMP\/bin\/php\/phpx.x.x\/bin<br \/>\n  \u4ee5\u4e0a\u7684x.x.x\u5c31\u662f\u60a8PHP\u7684\u7248\u672c<br \/>\n  \u4ee5\u8c46\u5b50\u7684\u74b0\u5883\u4f86\u770b\uff0c\u8def\u5f91\u5c31\u6703\u662f<br \/>\n  <code>\/Applications\/MAMP\/bin\/php\/php5.5.23\/binOpen <\/code><\/p>\n<p>3.\u958b\u958bTerminal\u4e26\u57f7\u884c\u4e0b\u5217\u6307\u4ee4:<br \/>\n  <code>export PATH=\/Applications\/MAMP\/bin\/php\/php5.5.23\/bin:$PATH<\/code><\/p>\n<p>4.\u5230PHP\u5b98\u7db2\u4e0b\u8f09PHP\u7684source\u6a94\uff1a<br \/>\n  \u9019\u90e8\u4efd\u53ef\u80fd\u8981\u7559\u610f\u4e00\u4e0b\uff0c\u50cf\u8c46\u5b50\u7684PHP\u662f5.5.23,\u4f46\u5b98\u7db2\u73fe\u5728\u4e3b\u8981\u63d0\u4f9b\u7684\u7248\u672c\u5df1\u7d93\u52305.5.35,\u9019\u662f\u6c92\u6709\u95dc\u4fc2\u7684\u3002<br \/>\n  \u5c31\u628a\u5b83\u4e0b\u8f09\u4e0b\u4f86\uff0c\u653e\u5230\u4ee5\u4e0b\u76ee\u9304\uff1a(\u9810\u8a2d\u662f\u6c92\u6709include\/php\u76ee\u9304\u7684\uff0c\u8acb\u81ea\u5efa\uff09<br \/>\n  <code>\/Applications\/MAMP\/bin\/php\/php5.5.23\/include\/php<\/code><\/p>\n<p>5.Configure the PHP source\uff1a<br \/>\n  <code>cd \/Applications\/MAMP\/bin\/php\/php5.5.23\/include\/php<\/code><br \/>\n  <code>.\/configure<\/code><br \/>\n  \u5728\u9019\u500b\u90e8\u9a5f\uff0c\u8c46\u5b50\u51fa\u73fe\u4ee5\u4e0b\u7684\u932f\u8aa4\uff1a<br \/>\n  <code>configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR><\/code><\/p>\n<p>\u4f46\u660e\u660e\u8c46\u5b50\u7684 \/usr\/bin\/iconv \u660e\u660e\u5c31\u6709\uff0c\u4f46\u600e\u9ebc\u6307\u5b9a\u5c31\u6c92\u6548<br \/>\n  \u4e0a\u7db2\u67e5\u4e00\u4e0b\uff0c\u5c31\u7528brew \u91cd\u65b0\u5b89\u88dd libiconv\u5427<\/p>\n<p><code>brew install homebrew\/dupes\/libiconv<\/code><\/p>\n<p>\u7136\u5f8c\u518d\u7528\u4ee5\u4e0b\u6307\u4ee4\u91cd\u65b0configure<\/p>\n<p><code>.\/configure --with-iconv=`brew --prefix libiconv`<\/code><\/p>\n<p>\u4e4b\u5f8c\u5c31\u6703\u770b\u5230Thank you for using PHP.\u7684\u8a0a\u606f\u5566<\/p>\n<p>6.Compile Phalcon\uff1a<br \/>\n  \u63a5\u8457\u4e0b\u8f09Phalcon\u56de\u4f86Compile<br \/>\n  <code>git clone --depth=1 git:\/\/github.com\/phalcon\/cphalcon.git<br \/>\n  cd cphalcon\/build<br \/>\n  sudo .\/install<\/code><br \/>\n  \u9019\u968e\u6bb5\u8c46\u5b50\u53c8\u5361\u95dc\u4e86\u3002\u3002\u3002<br \/>\n  \u51fa\u73fe\uff1a$PHP_AUTOCONF environment variable. Then, rerun this script.<br \/>\n  \u6240\u4ee5\uff0c\u7528brew\u518d\u88dd\u88ddautoconfig\u518d\u91cd\u65b0configure<br \/>\n <code> brew install autoconf<\/code><\/p>\n<p>7.\u5728php.ini\u88e1\u52a0\u5165phalcon extension file<br \/>\n  \u5982\u679c\u4e0d\u77e5\u9053\u4f60\u7684php.ini\u5728\u90a3\u88e1\uff0c\u7528phpinfo()\u770b\u4e00\u4e0b\u6700\u4fdd\u96aa<br \/>\n  \u5728php.ini\u88e1\u52a0\u4e0a<br \/>\n  <code>extension=phalcon.so<\/code><\/p>\n<p>8.\u91cd\u555fMAMP<\/p>\n<p>9.\u6aa2\u67e5\uff1a<br \/>\n  \u5728phpinfo()\u7684\u8cc7\u8a0a\u88e1\u61c9\u8a72\u5c31\u6703\u591a\u4e00\u500b phalcon\u7684\u76f8\u95dc\u8cc7\u8a0a\u56c9<\/p>\n<p><a class=\"shutterset_\" data-image-id=\"662\" data-src=\"http:\/\/192.168.50.160\/wordpress\/wp-content\/gallery\/20160522_phalcon\/phalcon.png\" data-thumbnail=\"http:\/\/192.168.50.160\/wordpress\/wp-content\/gallery\/20160522_phalcon\/thumbs\/thumbs_phalcon.png\" data-title=\"phalcon\" data-description=\" \" href='http:\/\/192.168.50.160\/wordpress\/wp-content\/gallery\/20160522_phalcon\/phalcon.png' title=' '><img src='http:\/\/192.168.50.160\/wordpress\/wp-content\/gallery\/20160522_phalcon\/thumbs\/thumbs_phalcon.png' alt='phalcon' class='ngg-singlepic ngg-none' \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u60f3\u4f86\u73a9\u73a9 Phalcon\uff0c \u4f46\u662f\u6211\u7684OSX\u662f\u5b89\u88ddMAMP\uff0c\u6240\u4ee5Phalcon\u5b98\u65b9\u91dd\u5c0dOSX\u63d0\u4f9b\u7684\u5b89\u88dd\u65b9\u6cd5\u4f3c\u4e4e\u4e0d\u592a\u7ba1\u7528\u3002 \u4e0a\u7db2\u67e5\u627e\u4e86\u4e00\u4e0b\uff0c\u767c\u73fe\u5fc5\u9700\u5c07MAMP\u88e1\u7684PHP\u91cd\u65b0\u518d\u7de8\u4e00\u4e0b\uff0c\u7d42\u65bc\u662f\u88dd\u8d77\u4f86\u4e86\uff0c\u6240\u4ee5\uff0c\u4f86\u8a18\u9304\u4e00\u4e0b\u5427!! 1.\u78ba\u5b9a\u4f60MAMP\u6240\u8dd1\u7684PHP\u7248\u672c: \u9019\u90e8\u4efd\u4f60\u53ef\u4ee5\u5728MAMP\u7684console\u6216&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2219,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":""},"categories":[1,14,10],"tags":[],"jetpack_featured_media_url":"https:\/\/history.dowdot.idv.tw\/wp-content\/uploads\/ngg_featured\/phalcon.png","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5NCTI-zH","_links":{"self":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2213"}],"collection":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2213"}],"version-history":[{"count":4,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2213\/revisions"}],"predecessor-version":[{"id":2222,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2213\/revisions\/2222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=\/wp\/v2\/media\/2219"}],"wp:attachment":[{"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/history.dowdot.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}