我試圖在優勝美地上編譯php(5.5.18,版本並不重要),但它在鏈接階段失敗。它看起來像一些Apache的符號消失了?在MacOSX 10.10上編譯php5.5.18時出錯(優勝美地)
(下面的工作完美的美洲獅,但未能在優勝美地)
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? – 2014-10-19 19:20:57
@MatthewBrown Homebrew目前在優勝美地上斷了。 – Qix 2014-10-19 19:28:31
@Qix homebrew在優勝美地上工作得很好!你到底在說什麼? – 2014-10-19 19:46:29