背景前几天在mac上跑了workrman。由于workerman需要开启多进程,多进程需要pcntl扩展的支持。我之前用brew安装的php71没有这个扩展,直接卸载了。拿到了php71,然后想下载源码编译安装更高版本的php7,也可以更自由的安装扩展。源码编译安装(php-7.2.7)问题一configure:警告:你应该使用--build,--host,--targetconfigure:警告:无效主机类型:configure:警告:你应该使用--build,--主机,--targetconfigure:警告:主机类型无效:--enable-fpmconfigure:警告:你应该使用--build,--host,--targetconfigure:警告:主机类型无效:--with-mysqlicconfigure:警告:你应该使用--build、--host、--targetconfigure:警告:主机类型无效:--with-pdo-mysqlconfigure:警告:你应该使用--build、--host、--targetconfigure:警告:主机类型无效:--with-iconv-dirconfigure:警告:你应该使用--build,--host,--targetconfigure:警告:无效的主机类型:--with-eeeetype-dirconfigure:警告:你应该使用--build,--host,--targetconfigure:警告:主机类型无效:--with-zlibconfigure:警告:你应该使用--build,--host,--targetconfigure:警告:主机类型无效:--with-jpeg-dirconfigure:警告:你应该使用--build,--host,--targetconfigure:WARNING:invalidhosttype:--with-png-dirconfigure:error:invalidvariablename:`--with-libxml-dir'解决方法:都是因为前面多了一个of--with空间问题2抱歉,我无法运行apxs。可能的原因如下:1.没有安装Perl2.没有找到apxs。尝试使用--with-apxs2=/path/to/apxs3传递路径。Apachewasnotbuiltusing--enable-so(显示apxs使用页面)解决方案brewinstallhttpdfind/-nameapxsCentos下执行yuminstall-yhttpd-devel找到apxs文件路径,然后修改编译参数为遵循--with-apxs2=/usr/local/bin/apxs问题3检查是否定义了ZLIB安装目录的位置...否;配置:错误:找不到libz。解决办法是brewinstallzlibfind/-namelib加参数--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11参考链接问题4configure:error:Cannotlocateheaderfilelibintl.h原因是没有gettext解决方案:$PHP_GETTEXT/usr/local/usr;将doconfigure文件更改为foriin$PHP_GETTEXT/usr/local/usr/usr/local/opt/gettext;请参考链接问题5configure:error:Pleasespecifytheinstallprefixoficonvwith--with-iconv=
