【发布时间】:2014-10-19 19:07:57
【问题描述】:
我正在尝试在 yosemite 上编译 php(5.5.18,版本无关紧要),但它在链接阶段失败。好像有些 apache 符号不见了?
(以下在 Mountain Lion 上完美运行,但在 Yosemite 上失败。)
cc -bundle -bundle_loader /usr/sbin/httpd -L/usr/lib -laprutil-1 -lldap -llber -lexpat -liconv -lsqlite3 -lldap -llber -L/usr/lib -lapr-1 -lpthread -I/usr/include -g -O2 -fvisibility=hidden -arch x86_64 -bind_at_load
<SNIP>
sapi/apache2handler/php_functions.o main/internal_functions.o -lcrypto -lssl -lcrypto -lz -lexslt -ltidy -lresolv -ledit -lncurses -lltdl -lldap -llber -lstdc++ -liconv -liconv -lz -lcrypto -lssl -lcrypto -lcurl -lbz2 -lz -lcrypto -lssl -lcrypto -lm -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -lbz2 -lxml2 -lnetsnmp -lcrypto -lxml2 -lxml2 -lxml2 -lxml2 -lxml2 -lxml2 -lxml2 -lxslt -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so
Undefined symbols for architecture x86_64:
"_ap_get_server_version", referenced from:
_zif_apache_get_version in php_functions.o
_zm_info_apache in php_functions.o
"_ap_log_error", referenced from:
_php_pre_config in sapi_apache2.o
_php_handler in sapi_apache2.o
_php_apache_sapi_log_message in sapi_apache2.o
"_ap_log_rerror", referenced from:
_php_handler in sapi_apache2.o
_php_apache_sapi_log_message in sapi_apache2.o
"_unixd_config", referenced from:
_zm_info_apache in php_functions.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/libphp5.bundle] Error 1
有什么想法吗?我检查了 /usr/lib/libapr-1.dylib (使用 nm -g)并且符号不存在。我通常应该在哪里找到这些符号?这是缺少一个库吗?真正奇怪的是,我的自定义构建脚本在 10.9 上运行良好,但在 10.10 上却失败了
感谢您的帮助! 尼古拉斯
【问题讨论】:
-
这可能不是您问题的直接答案,但考虑过使用macports 或home brew 安装php?另外,我认为 OSx 默认带有 apache 和 PHP?
-
@MatthewBrown Homebrew 目前在优胜美地被破坏。
-
@Qix homebrew 在优胜美地上运行良好!你到底在说什么?
-
@BradAllred Please research first. 有很多报告,很多受影响。
-
@Qix 我在优胜美地上运行得很好;无需研究即可确定这一事实。您的链接中提到的问题表明,自制软件中的一些 packages (无论如何都想使用 gcc :p )在 Yosemite 下存在问题。这并不意味着自制软件本身就有这些问题(它没有)。 PHP 包是否有效我不知道。