mac如何编译安装 php7
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章主要介绍mac如何编译安装 php7,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!mac编译安装php7的方法:1、通过"wget -c http://mirrors.
千家信息网最后更新 2026年11月01日mac如何编译安装 php7
这篇文章主要介绍mac如何编译安装 php7,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
mac编译安装php7的方法:1、通过"wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz"下载PHP;2、通过"tar -zxvf php-7.1.8.tar.gz"解压编译即可。
本文操作环境:macOS10.15系统,PHP7.1.8版,macbook pro 2020电脑。
Mac编译安装PHP7.1.8:
1、下载稳定版本的PHP
wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz
2、解压编译
tar -zxvf php-7.1.8.tar.gz./configure --prefix=/usr/local/php/7.1.8 \--with-config-file-path=/usr/local/php/7.1.8/etc \--with-config-file-scan-dir=/usr/local/php/7.1.8/etc/conf.d \--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-zlib \--with-jpeg-dir \--with-png-dir \--with-libxml-dir=/usr/bin/xml2-config \--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 \--enable-mysqlnd遇到的问题:
apxs报错的问题
Sorry, I cannot run apxs. Possible reasons follow:1. Perl is not installed2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决方案:查找httpd安装目录下的bin目录里的 apxs ,尽量不要写/usr/bin/apxs
由于Mac自带的openssl没法升级(我没找到升级的办法),导致版本较低,报错:
configure: error: OpenSSL version 1.0.1 or greater required.
解决方案:由于Mac自带的openssl没法升级(我没找到升级的办法),用
brew install openssl
安装最新版的openssl,然后在参数中加上brew安装的ssl的路径
--with-openssl=/usr/local/Cellar/openssl@1.1/1.1.0e
--with-gettext报错
configure: error: Cannot locate header file libintl.h
解决方案:
brew install gettext
打开PHP的 configure文件,修改文件的
for i in $PHP_GETTEXT /usr/local /usr/ ;do
改成
for i in $PHP_GETTEXT /usr/local /usr/ usr/local/opt/gettext;do
libiconv问题,报错如下:
checking for iconv... nochecking for libiconv... noconfigure: error: Please specify the install prefix of iconv with --with-iconv=
解决方案:
安装 libiconv (字符编码转换库)
网站地址: http://www.gnu.org/software/libiconv/
当前版本: https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
$ wget [https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz$ tar zxvf libiconv-1.15.tar.gz$ cd libiconv-1.15$ ./configure --prefix=/usr/local/lib/libiconv$ make$ sudo make install
安装
make && sudo make install
以上是"mac如何编译安装 php7"这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注行业资讯频道!
编译
方案
解决方案
升级
版本
问题
内容
办法
文件
目录
篇文章
价值
兴趣
参数
地址
字符
小伙
小伙伴
方法
更多
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
咖啡网
云南咖啡
精品咖啡豆
互联网核心科技是什么
重庆互联网络科技
美国互联网科技
深圳互联网络科技有限公司
上海挚品互联网科技
互联网科技ppt模板
互联网女皇 腾讯科技
上游互联网科技
新华互联网科技校企合作
老年人脱离互联网科技的作文
互联网5g黑科技有哪些
玉溪互联网科技怎么选
为客找房互联网科技公司怎么样
互联网科技实习生岗位
互联网的科技体现在哪里
平安好医生打造互联网科技医疗
东风日产互联网科技公司叫什么
互联网络科技
西安互联网科技
衡水科技产业互联网平台
小米互联网科技园设置
中化能源互联网科技招聘
互联网经济与金融科技
重庆互联网医院沙龙医盟信息科技
群盈汇互联网科技有限公司
卡尔迅互联网科技有限公司
广州智享互联网科技