• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Mac下编译安装php-5.6

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

1.安装 PHP

1.1 下载源码包

http://php.net/get/php-5.6.35.tar.bz2/from/a/mirror

 

1.2 编译&安装

./configure --prefix=/usr/local/php-5.6.35 --with-config-file-path=/usr/local/php-5.6.35/etc --with-bz2 --with-curl --enable-ftp \
--enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-iconv-dir \
--enable-mbstring --enable-calendar --with-gettext --with-libxml-dir --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm 
make & make install

 

1.3 出现的错误处理

提示错误:crun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

处理方法 :

xcode-select --install

 

提示错误:Cannot locate header file libintl.h

处理方法 :

brew install gettext
brew link --force gettext
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc

编辑 configure 文件,将 

for i in $PHP_GETTEXT /usr/local /usr; do

修改为:

for i in $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext; do

 

提示错误:Please reinstall the iconv library

处理方法 :

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar xvzf libiconv-1.15.tar.gz
./configure 
make && make install

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP中的转义函数发布时间:2022-07-10
下一篇:
PHP项目性能优化-HHVM安装使用发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap