首页 / PHP / mac搭建PHP环境
mac搭建PHP环境
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mac搭建PHP环境,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1743字,纯文字阅读大概需要3分钟。
内容图文
1.先安装好各种插件,第一个是命令行工具,打开终端之后,输入xcode-select –install,同意之后进行安装。第二个是HomeBrew,终端输入ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"第三个安装autoconf,输入brew install autoconf
2.开始在Mac中导入PHP的包。
终端输入./buildconf --force
./configure--prefix=/usr/local/php7 --with-apxs2=/usr/sbin/apxs --enable-fpm--with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql--with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib--with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath--enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex--enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf--with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc--enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo--enable-maintainer-zts
3.解决错误
1)configure: error: Cannot find OpenSSL's
brew install openssl
brew link openssl –force
2)configure: error: jpeglib.h not found.
brew install libjpeg
3)configure: error: png.h not found.
brew install libpng
4)freetype
前往苹果官方开源支持:http://www.apple.com/opensource/查找并下载GD需要的 zlib/libpng/jpeg/freetype/libgd,这里提供一个包及执行脚本:
tar -zxf gd.tar.gz
cd gd
sudo ./install
4) configure:error: Cannot locate header file libintl.h
安装 gettext
sudo brew install gettext
编辑 configure 文件,找到 $PHP_GETTEXT /usr/local /usr 在后面加上gettext的路径 $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext
5) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
brew install wget
http://www.tuicool.com/articles/yaQnmi2
以上就介绍了mac搭建PHP环境,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
内容总结
以上是互联网集市为您收集整理的mac搭建PHP环境全部内容,希望文章能够帮你解决mac搭建PHP环境所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。