在Mac OS上自行编译安装Apache服务器和PHP解释器
php  /  管理员 发布于 7年前   138
Apache 2.2.27和PHP 5.5.12在Mac OS X 10.8.5编译安装过程: 然后进入Apache的源码包,对于大部分的源码包都可以使用下面这个指令来查看编译选项: 配置编译选项: 报错: 上面的报错是指路径: 不存在 解决方法: 接着编译并安装: 编辑配置文件httpd.conf,一般修改监听端口、运行Apache的用户和组、服务器名称、开启gzip等配置。 进入安装好的目录启动Apache: 安装PHP 关于PHP编译选项可以参考: PHP: List of core configure options - Manual 整个编译过程需要5-10分钟,视硬件配置而定,可以先去弄杯牛奶喝 发生错误: 解决: 错误: 解决: 重新编译并安装: 安装完成,此时需要从PHP的源码目录copy一份配置文件到安装目录的etc文件夹下面并改名为php.ini,需要更改PHP的配置时就使用该文件即可。
在开始之前首先升级Xcode的组件: preferences => Downloads => 下载Command Line Tools包./configure --help
./configure --prefix=/Users/levin/dev/apache2.2.27 --enable-modules=most --enable-mods-shared=all
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
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
cd /Applications/Xcode.app/Contents/Developer/Toolchainssudo ln -s XcodeDefault.xctoolchain OSX10.8.xctoolchain
makemake install
./bin/apachectl start
./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
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.old: symbol(s) not found for architecture x86_64collect2: ld returned 1 exit statusmake: *** [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/libln -s /usr/local/mysql-5.6.12-osx10.7-x86_64/lib/libmysqlclient.18.dylib libmysqlclient.18.dylib
make clean && makemake install
您可能感兴趣的文章:
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号