TODO:macOS编译PHP7.1
mac php开发环境搭建。本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下。
1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.gz
macpython怎么运行,2.解压php-7.1.0.tar.gz包
3.创建配置
./configure �Cprefix=/usr/local/php7 �Cwith-apxs=/usr/sbin/apxs �Cenable-fpm �Cwith-fpm-user=www �Cwith-fpm-group=www �Cwith-mysqli �Cwith-pdo-mysql �Cwith-iconv-dir �Cwith-freetype-dir �Cwith-jpeg-dir �Cwith-png-dir �Cwith-zlib �Cwith-libxml-dir=/usr �Cenable-xml �Cdisable-rpath �Cenable-bcmath �Cenable-shmop �Cenable-sysvsem �Cenable-inline-optimization �Cwith-curl �Cenable-mbregex �Cenable-mbstring �Cwith-mcrypt �Cenable-ftp �Cwith-gd �Cenable-gd-native-ttf �Cwith-openssl �Cwith-mhash �Cenable-pcntl �Cenable-sockets �Cwith-xmlrpc �Cenable-zip �Cenable-soap �Cwithout-pear �Cwith-gettext �Cdisable-fileinfo �Cenable-maintainer-zts
4.编译代码
make
make test
5.安装php
make install
6.顺利的花这样就把php7.1编译好了,把php7对应的执行文件拷贝到/usr/bin/ 即可在终端使用了
sudo cp /usr/local/php7/bin/ph* /usr/bin/
7.编译步骤是很简单,但是编译过程难免会遇到一些问题,以下是小编遇到的问题总结
8.安装autoconf
9.openssl版本问题
configure: error: OpenSSL version 1.0.1 or greater required.
安装更高版本的openssl或者下载openssl源码来编译,简单的方法就是使用brew来安装
10.Cannot find libz,这个需要安装xcode-select,在终端输入xcode-select �Cinstall
11.Cannot locate header file libintl.h
安装gettext
编辑php源码configure文件
把
改成
12.mcrypt.h not found. Please reinstall libmcrypt.
安装libmcrypt
13. 基本就是遇到这些情况了,还有一种使用php7的方法就是安装MAMP,是商业软件存在试用期限制,可以把安装好的php7文件取出来使用,小编试过,可以正常使用。
wxgzh:ludong86
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态