一時興起裝個Phalcon玩玩;環境:
macOS 10.十一、mamp version 3.五、php version 7.0.0、shell zshphp
which php
再此以前我已經使用brew
安裝了一個php7.0.11,因此個人php命令源是/usr/local/bin/php
,在以後的安裝中還須要用到該版本的源碼文件;mysql
刪除brew安裝建立的軟連接,替換爲mampgit
sudo ln -s /Applications/MAMP/bin/php/php7.0.0/bin/php /usr/local/bin/php sudo ln -s /Applications/MAMP/bin/php/php7.0.0/bin/phpize /usr/local/bin/phpize sudo ln -s /Applications/MAMP/bin/php/php7.0.0/bin/php-config /usr/local/bin/php-config sudo ln -s /Applications/MAMP/bin/php/php7.0.0/bin/pecl /usr/local/bin/pecl
git clone git://github.com/phalcon/cphalcon.git cd cphalcon/build sudo ./install
/Applications/MAMP/bin/php/php7.0.0/lib/php/build'. Please check your PHP installation.
將brew安裝的php源碼目錄下的build文件夾下的全部內容copy到mamp源碼路徑中,你也能夠去php.net下載源碼複製;github
grep: /Applications/MAMP/bin/php/php7.0.0/include/php/main/php.h: No such file or directory grep: /Applications/MAMP/bin/php/php7.0.0/include/php/Zend/zend_modules.h: No such file or directory grep: /Applications/MAMP/bin/php/php7.0.0/include/php/Zend/zend_extensions.h: No such file or directory
將brew安裝的php源碼目錄下的include文件夾下的全部內容copy到mamp源碼路徑中;sql
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
使用brew安裝m4與autoconf便可shell
brew install m4 brew install autoconf
解決以上文件,再次執行install
腳本便可;apache
添加extension=phalcon.so
json
打印一下bash
print_r(get_loaded_extensions()); //結果: Array ( [0] => Core [1] => date [2] => libxml [3] => openssl [4] => pcre [5] => sqlite3 [6] => zlib [7] => bcmath [8] => bz2 [9] => calendar [10] => ctype [11] => curl [12] => dom [13] => hash [14] => fileinfo [15] => filter [16] => ftp [17] => gd [18] => SPL [19] => iconv [20] => intl [21] => json [22] => ldap [23] => mbstring [24] => session [25] => standard [26] => mysqlnd [27] => PDO [28] => pdo_mysql [29] => pdo_sqlite [30] => Phar [31] => posix [32] => Reflection [33] => mysqli [34] => SimpleXML [35] => soap [36] => sockets [37] => exif [38] => tokenizer [39] => wddx [40] => xml [41] => xmlreader [42] => xmlwriter [43] => xsl [44] => zip [45] => apache2handler [46] => imap [47] => mcrypt [48] => pgsql [49] => pdo_pgsql [50] => phalcon )
若是輸出中有phalcon
安裝成功;session