我已将 Mac 升级到 macOS 10.12.0 Sierra,并尝试将 PHP 升级到 7.0.9 版,但“make test”失败并显示:
Undefined symbols for architecture x86_64:
"_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
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp7.bundle] Error 1
我编译它:
./configure --prefix=/usr/local/php5 --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc --with-config-file-path=/etc --with-zlib --with-zlib-dir=/usr --with-openssl=/usr/local --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-apxs2=/usr/local/apache2/bin/apxs --enable-zip --with-curl
并尝试添加不同的 '--with-iconv-dir=' 选项,但总是得到相同的未定义符号错误。
我已经下载并编译了 libiconv 无济于事。甚至配置了编译:
CFLAGS='-arch x86_64' CCFLAGS='-arch x86_64' CXXFLAGS='-arch x86_64' ./configure
但这并没有什么不同。有什么建议么?
任何帮助将非常感激。