解决PHP5在Snow Leopard(Mac OSX 10.6)上的编译错误
今天在Snow Leopard重新编译PHP5.2.6, 在最后link时出现错误:
Undefined symbols:
"_res_9_dn_expand", referenced from:
_zif_dns_get_mx in dns.o
"_res_9_search", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_check_record in dns.o
"_res_9_dn_skipname", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_get_mx in dns.o
ld: symbol(s) not found
配置和编译脚本应该没有问题,仔细检查了下configure 的输出,应该是link的时候没有link进 resolv 库。看来是PHP的配置脚本无法正确识别10.6造成的。google了一下,果然:
是这个Bug造成的。在5.2.11-dev中已经修复了。
我需要使用5.2.6, 修正也简单,设置LIBS变量,强制link resolv库就好了:
LIBS='-lresolv' \
./configure \
--prefix=/opt/php5 \
....
其他关于Snow Leopard的一些小问题:
* macport需要更新到1.8
* mysql重新下载5.1.37包
* PD中如果PPS无法观看,重新安装Parallels Tools就ok
* 要避免在macport中重复perl 5.8.9,可以ln -s /opt/local/bin/perl5.10 为/opt/local/bin/perl
这些问题作为普通用户应该遇不到,但在mac port/darwin中编译的libs就有问题了。一般都是dylib无法加载,出现image not found,因为port中gcc只生成特定的代码,而非通用代码,当运行库变更后就无法正常加载了.
解决办法就是重新编译一下。
重新编译一下。
Comments
Leave a Reply