macOS使用MAMP集成环境安装Phalcon

分享 6 1406
ityike
ityike   会员 发布于:17个月前
悬赏:60飞吻

一时兴起装个Phalcon玩玩;环境:
macOS 10.11、mamp version 3.5、php version 7.0.0、shell zsh

1、查看目前的php全局命令来源

which php

再此之前我已经使用brew安装了一个php7.0.11,所以我的php命令源是/usr/local/bin/php,在之后的安装中还需要用到该版本的源码文件;

2、使用mamp的php cli

删除brew安装创建的软链接,替换为mamp

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

3、下载Phalcon

git clone git://github.com/phalcon/cphalcon.gitcd cphalcon/buildsudo ./install

4、错误提示解决

/Applications/MAMP/bin/php/php7.0.0/lib/php/build'. Please check your PHP installation.

将brew安装的php源码目录下的build文件夹下的所有内容copy到mamp源码路径中,你也可以去php.net下载源码复制;

grep: /Applications/MAMP/bin/php/php7.0.0/include/php/main/php.h: No such file or directorygrep: /Applications/MAMP/bin/php/php7.0.0/include/php/Zend/zend_modules.h: No such file or directorygrep: /Applications/MAMP/bin/php/php7.0.0/include/php/Zend/zend_extensions.h: No such file or directory

将brew安装的php源码目录下的include文件夹下的所有内容copy到mamp源码路径中;

Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.

使用brew安装m4与autoconf即可

brew install m4brew install autoconf

解决以上文件,再次执行install脚本即可;

5、修改ini文件

添加extension=phalcon.so

6、确认安装

打印一下

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安装成功;

回帖
  • 17个月前

    大神,那个include文件是从哪里下载的啊

    0 回复
  • 直接复制对应版本的php源码相应文件夹的进去即可,php.net下载

    0 回复
  • 我用的是MAMP3.5.2,php版本是7.0.8,php.net上只有7.0.14,我下载下来后里面没有include这个文件夹啊,下载下来后是需要安装到mac上吗?mac自带php5.6版本

    0 回复
  • 把7.0.14里的复制到mamp的php目录下就可以了!

    0 回复
  • 17个月前

    重点是我下载的里面没有include这个文件夹,是没有这个文件夹,能不能把你的php7.0.11发给我一份,我的qq1038348434,跪求大神。

    0 回复
  • 17个月前

    要编译

    0 回复

ityike 会员

2017-12-09 加入 来自中国

(这个人懒得留下签名)

活跃榜
大家好像都不是很活跃
本周热门
本周暂无热帖