这是我收到的消息:
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 身份登录。
以下是更多详细信息:
PHP-5.5.13 Mac OS X 10.9.3
答案1
看起来 PHP 无法找到符号,因为 iconv 重命名了它们。
详细信息请参见以下链接:
引述:
MacPorts iconv 库将符号重命名为 _libiconv_open 和 _libiconv_close。这就是 PHP 找不到它们的原因……运行 nm /opt/local/lib/libiconv.dylib vs nm /usr/lib/libiconv.dylib(在 10.7.3 中)。