书中使用的是7.0版本,因为在php.net上下载太慢,所以使用本地已有的7.2版本代码../configure--prefix=/Users/luzhifang/php/php-7.3.4/output/时出现错误--enable-fpmconfigure:error:Pleasespecifytheinstallprefixwith--with-iconv=
这是因为iconv模块是php模块是默认安装的。如果这里不需要iconv,可以使用--without-iconv。如果要编译iconv模块,可以按如下方式解决。首先,找到机器上安装libiconv的目录。如果未安装,请转至您只能先自行安装。本机libiconv目录为/usr/local/opt/libiconv,所以重新执行configure命令/configure--prefix=/Volumes/Samsung_T5/useful-zips/php7--enable-debug--enable-fpm--with-iconv=/usr/local/opt/libiconv/ok,配置成功。然后执行makemake,报错-lz-licucore-lm-osapi/cli/phpUndefinedsymbolsforarchitecturex86_64:"_libiconv",referencedfrom:_php_iconv_stringiniconv.o__php_iconv_strleniniconv.o__php_iconv_substriniconv.o__php_iconv_strposiniconv。oiconv.o中的__php_iconv_mime_encodeiconv.o中的__php_iconv_appendl_php.iconv_stream_filter_append_b...“ibiconv_close”,引用自:iconv.o中的_php_iconv_stringiconv.o中的__php_iconv_strleniconv.o中的__php_iconv_substriconv.o中的__php_iconv_strposiconv.o中的__php_iconv_mime_encodeiconv.o中的__php_iconv_mime_decodeiconv.o中的_php_iconv_stream_filter_dtor,“参考iconv.o中的...”:iconv.o中的_php_iconv_stringiconv.o中的__php_iconv_strleniconv.o中的__php_iconv_substriconv.o中的__php_iconv_strposiconv.o中的__php_iconv_mime_encodeiconv.o中的__php_iconv_mime_decodeiconv.o中的_php_iconv_stream_filter_ctor...ld:symbol(s)xlang6_4notfoundforarchitecture:error:linkercommandfailedwithexitcode1(使用-v查看调用)make:***[sapi/cli/php]Error1解决方案在Makefile文件中搜索liconv,will,willEXTRA_LIBS=inthisline-liconv替换为/usr/local/opt/libiconv/lib/libiconv.dylibmake&&makeinstall再次编译成功完成d.PS,如果MacOS安装gdb调试工具报错,请参考https://stackoverflow.com/questions/52529838/gdb-8-2-cant-recognized-executable-file-on-macos-mojave-10-14https://blog.csdn.net/weixin_41978191/article/details/89431694