Apache 2.2.27和PHP 5.5.12在Mac OS X 10.8.5编译安装过程:
在开始之前首先升级Xcode的组件: preferences => Downloads => 下载Command Line Tools包
然后进入Apache的源码包,对于大部分的源码包都可以使用下面这个指令来查看编译选项:
checking for APR-util... yes
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/Users/levin/Downloads/httpd-2.2.27':
configure: error: C compiler cannot create executables
See `config.log' for more details
Undefined symbols for architecture x86_64:
"_res_9_init", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_get_record in dns.o
_zif_dns_check_record in dns.o
"_res_9_search", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_get_record 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_record in dns.o
"_res_9_dn_expand", referenced from:
_zif_dns_get_mx in dns.o
_php_parserr in dns.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
解决:
export LDFLAGS=-lresolv
错误:
dyld: Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/levin/Downloads/php-5.5.12/sapi/cli/php
Reason: image not found
...
make: *** [ext/phar/phar.php] Error 133
解决:
cd /usr/lib
ln -s /usr/local/mysql-5.6.12-osx10.7-x86_64/lib/libmysqlclient.18.dylib libmysqlclient.18.dylib