php5.6 mac 编译安装错误

解决方法:https://bugs.php.net/bug.php?id=71343

php7 makefile中搜索并删除如下内容

-L/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib

详细报错:

Undefined symbols for architecture x86_64:

“_append_history”, referenced from:

_readline_shell_run in readline_cli.o

“_history_list”, referenced from:

_zif_readline_list_history in readline.o

“_libiconv”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_appendl in iconv.o

_php_iconv_stream_filter_append_bucket in iconv.o

“_libiconv_close”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_mime_decode in iconv.o

_php_iconv_stream_filter_factory_create in iconv.o

“_libiconv_open”, referenced from:

_zif_iconv_substr in iconv.o

_zif_iconv_mime_encode in iconv.o

_php_iconv_string in iconv.o

__php_iconv_strlen in iconv.o

__php_iconv_strpos in iconv.o

__php_iconv_mime_decode in iconv.o

_php_iconv_stream_filter_factory_create in iconv.o

“_rl_done”, referenced from:

_zif_readline_info in readline.o

“_rl_mark”, referenced from:

_zif_readline_info in readline.o

“_rl_pending_input”, referenced from:

_zif_readline_info in readline.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [sapi/cli/php] Error 1

php5.6 编译安装

./configure \ --prefix=/usr/local/php56 \ --with-config-file-path=/usr/local/php56/etc \ --enable-inline-optimization \ --disable-debug \ --disable-rpath \ --enable-shared \ --enable-opcache \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-gettext=/usr/local/Cellar/gettext/0.19.8.1 \ --enable-mbstring \ --with-iconv=/usr/local/Cellar/libiconv/1.15 \ --with-mcrypt \ --with-mhash \ --with-openssl="/usr/local/Cellar/openssl/1.0.2p" \ --enable-bcmath \ --enable-soap \ --with-libxml-dir \ --enable-pcntl \ --enable-shmop \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-sockets \ --with-curl="/usr/local/Cellar/curl/7.63.0" \ --with-zlib="/usr/local/Cellar/zlib/1.2.11" \ --enable-zip \ --with-bz2=/usr/local/Cellar/bzip2/1.0.6_1 \ --with-readline=/usr/local/Cellar/readline/7.0.5

make

make install