Apache 2.2.27 and PHP 5.5.12 in Mac OS X 10.8.5 Compile the installation process:
Before you begin, upgrade the components of Xcode: Preferences = Downloads = Download command line tools package
Then enter the Apache source package, for most of the source package can use the following command to see the compilation options:
./configure--help
To configure compilation options:
./configure--prefix=/users/levin/dev/apache2.2.27--enable-modules=most--enable-mods-shared=all
Error:
Checking for Apr-util ... Yeschecking for GCC .../applications/xcode.app/contents/developer/toolchains/osx10.8.xctoolchain/usr/bin/ Ccchecking whether the C compiler works ... noconfigure:error:in '/users/levin/downloads/httpd-2.2.27 ': configure:error : C compiler cannot create Executablessee ' config.log ' for more details
The above error refers to the path:
/applications/xcode.app/contents/developer/toolchains/osx10.8.xctoolchain/usr/bin/cc
does not exist
Workaround:
Cd/applications/xcode.app/contents/developer/toolchainssudo ln-s Xcodedefault.xctoolchain OSX10.8.xctoolchain
Then compile and install:
Makemake Install
Edit the configuration file httpd.conf, generally modify the listening port, run Apache users and groups, server name, open gzip configuration.
Go to the installed directory to start Apache:
./bin/apachectl Start
Install PHP
For PHP Compile options refer to: Php:list of core Configure Options-manual
./configure--prefix=/users/levin/dev/php5.5.12--with-apxs2=/users/levin/dev/apache2.2.27/bin/apxs-- With-config-file-path=/users/levin/dev/php5.5.12/etc--with-openssl--with-zlib--enable-bcmath--with-bz2-- With-curl--enable-ftp--with-gd--enable-gd-native-ttf--with-mhash--enable-mbstring--enable-soap--enable-zip-- Enable-sockets--with-mysql=/usr/local/mysql-5.6.12-osx10.7-x86_64--with-mysqli=/usr/local/ Mysql-5.6.12-osx10.7-x86_64/bin/mysql_config--with-iconv--with-pear--enable-opcachemake
The entire compilation process takes 5-10 minutes, depending on the hardware configuration, you can get a cup of milk to drink first
Error occurred:
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< C4/>_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< C9/>_php_parserr in Dns.old:symbol (s) is found for architecture X86_64collect2:ld returned 1 exit statusmake: * * * [libs /libphp5.bundle] Error 1
Solve:
Export LDFLAGS=-LRESOLV
Error:
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
Solve:
Cd/usr/libln-s/usr/local/mysql-5.6.12-osx10.7-x86_64/lib/libmysqlclient.18.dylib Libmysqlclient.18.dylib
Recompile and install:
Make clean && makemake install
Installation is completed, you need to copy a configuration file from PHP source directory to the installation directory under the ETC folder and renamed to PHP.ini, you need to change the configuration of PHP to use the file.