编译PHP的问题make:*** 错误1

这是我得到的消息:

Undefined symbols for architecture x86_64: "_iconv_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_cleanup in iconv.o ... "_iconv_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: *** [sapi/cli/php] Error 1 

在编译Make时,我也一直收到警告。

例如:

 zend_operators.c:2171:34: warning: 'finite' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations] } else if (dval1 == dval2 && !zend_finite(dval1)) { zend_compile.c:4010:9: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] lcname = hash_key->arKey; ^ ~~~~~~~~~~~~~~~ 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign] sc = YYCURSOR; ^ Zend/zend_ini_scanner.l:479:12: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] YYCURSOR = sc; 

他们是更多的那些。

这是我的命令:

 ./configure --enable-fpm --with-pdo-mysql --with-mcrypt --with-zlib --with-openssl --with-curl make 

我以root身份login。

这里有更多的细节:

PHP-5.5.13 Mac OS X 10.9.3

看起来像PHP无法find符号,因为iconv重命名它们。

详细信息请参阅以下链接:

超级用户通过fidell回答

qoute:

MacPorts iconv库将符号重命名为_libiconv_open和_libiconv_close。 这就是PHP无法find它们的原因,…运行nm /opt/local/lib/libiconv.dylib vs nm /usr/lib/libiconv.dylib(在10.7.3中)。