gpt4 book ai didi

php - 在 MacOSX 10.10 (yosemite) 上编译 php5.5.18 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:42:29 25 4
gpt4 key购买 nike

我正在尝试在优胜美地编译 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 上失败

感谢您的帮助!尼古拉斯

最佳答案

原来它使用了以下包含路径:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/apache2/

而不是普通的:

/usr/include/apache2/

更多信息:

$ xcodebuild -version -sdk macosx

MacOSX10.9.sdk - OS X 10.9 (macosx10.9)
SDKVersion: 10.9
Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
PlatformVersion: 1.1
PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
ProductBuildVersion: 13F26
ProductCopyright: 1983-2014 Apple Inc.
ProductName: Mac OS X
ProductUserVisibleVersion: 10.9.5
ProductVersion: 10.9.5

奇怪,我希望它能帮助其他人。

最好的,尼古拉斯

关于php - 在 MacOSX 10.10 (yosemite) 上编译 php5.5.18 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26454255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com