下载 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_