首页 / PHP / 编译PHP make时遇到的问题
编译PHP make时遇到的问题
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了编译PHP make时遇到的问题,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3869字,纯文字阅读大概需要6分钟。
内容图文
编译PHP make时遇到的问题
问题一
1.1 make 报错内容
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
_zif_iconv_substr in iconv.o
__php_iconv_strpos in iconv.o
_zif_iconv_mime_encode in iconv.o
__php_iconv_appendl in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o ...
"_libiconv_close", referenced from:
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
_zif_iconv_substr in iconv.o
__php_iconv_strpos in iconv.o
_zif_iconv_mime_encode in iconv.o
__php_iconv_mime_decode in iconv.o
_php_iconv_stream_filter_factory_create in iconv.o ...
"_libiconv_open", referenced from:
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
_zif_iconv_substr in iconv.o
__php_iconv_strpos in iconv.o
_zif_iconv_mime_encode 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
1.2 解决方式
./configure --with-iconv=/usr/local/opt/libiconv
# 修改 Makefile 文件
# 将 `EXTRA_LIBS =` 这一行内的 `-liconv` 替换成 `/usr/local/opt/libiconv/lib/libiconv.dylib`
1.3 参考链接
https://learnku.com/laravel/t/21640
问题二
2.1 make 报错内容
Undefined symbols for architecture x86_64:
"_res_9_init", referenced from:
_zif_dns_check_record in dns.o
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
"_res_9_search", referenced from:
_zif_dns_check_record in dns.o
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
"_res_9_dn_skipname", referenced from:
_zif_dns_get_record in dns.o
_zif_dns_get_mx in dns.o
"_res_9_dn_expand", referenced from:
_php_parserr in dns.o
_zif_dns_get_mx in dns.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
2.2 解决方法
执行 export LDFLAGS=-lresolv
2.3 参考链接
http://www.52gl.net/dnwl/bckf/20190319/13022.html
问题三
3.1 make报错内容
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /Users/pandaliu/dev/php/php-7.2.26/sapi/cli/php
Reason: image not found
/bin/sh: line 1: 6184 Abort trap: 6 .... > ext/phar/phar.php
make: *** [ext/phar/phar.php] Error 134
3.2 解决方法
# 移除openssl(移除方式可能会有其他版本存在,建议是通过uninstall卸载所有版本)
brew remove openssl
# 卸载所有版本openssl
brew uninstall --force openssl
# 安装openssl
brew install openssl
# 配置环境变量
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
3.3 参考链接
https://www.jianshu.com/p/c6d6a60002e4
问题四
4.1 make报错内容
Undefined symbols for architecture x86_64:
"_PKCS5_PBKDF2_HMAC", referenced from:
_zif_openssl_pbkdf2 in openssl.o
"_SSL_CTX_set_alpn_protos", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_SSL_CTX_set_alpn_select_cb", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_SSL_get0_alpn_selected", referenced from:
_php_openssl_sockop_set_option in xp_ssl.o
"_SSL_select_next_proto", referenced from:
_server_alpn_callback in xp_ssl.o
"_TLSv1_1_client_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_1_server_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_2_client_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_2_server_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4.2 解决方法
打开php源码根目录,打开 Makefile
修改 EXTRA_LIBS =
这一行内的 -lcrypto
和 -lssl
,替换成
/usr/local/opt/openssl/lib/libcrypto.dylib
/usr/local/opt/openssl/lib/libssl.dylib
4.3 参考链接
原文:https://www.cnblogs.com/pandaLIU/p/12197304.html
内容总结
以上是互联网集市为您收集整理的编译PHP make时遇到的问题全部内容,希望文章能够帮你解决编译PHP make时遇到的问题所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。