MacOS编译安装PHP7及解决各种编译错误

下载 PHP7.1.0,并编译安装

$ wget http://cn2.php.net/distributions/php-7.1.0.tar.gz
$ tar -zxvf php-7.1.0.tar.gz
$ cd php-7.1.0
$ ./configure --prefix=/Users/null/work/php/php-7.1.0/output --enable-fpm
$ make && make install

报错1

configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>

解决办法:安装 libiconv,增加编译参数 --with-iconv=/usr/local/opt/libiconv/

$ brew install libiconv
$ ./configure --prefix=/Users/null/work/php/php-7.1.0/output --enable-fpm --with-iconv=/usr/local/opt/libiconv/

报错2

/Users/null/work/php/php-7.1.0/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/dirent.h:110:5: note: 'readdir_r' declared here
int readdir_
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值