mac php7 mysql.so_[安装] mac安装PHP7经历
背景
前几天在mac上跑workrman,由于workerman需要开启多个进程,多进程需要pcntl扩展的支持,我之前那个brew安装的php71没有这个扩展,就直接卸载了php71,然后想下载源码编译安装php7的更高版本,也可以更自由的安装扩展。
源码编译安装(php-7.2.7)
问题一
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --enable-fpm
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-mysqli
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-pdo-mysql
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-iconv-dir
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-eeeetype-dir
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-zlib
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-jpeg-dir
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: --with-png-dir
configure: error: invalid variable name: ` --with-libxml-dir'
解决:都是因为—with前面多了个空格
问题二
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决办法
brew install httpd
find / -name apxs
Centos下执行 yum install -y httpd-devel
查找到apxs文件路径,然后修改编译参数如下
--with-apxs2=/usr/local/bin/apxs
问题三
checking if the location of ZLIB install directory is defined... no ;
configure: error: Cannot find libz.
解决办法
brew install zlib
find / -name lib
加上参数
--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
问题四
configure: error: Cannot locate header file libintl.h
原因是没有gettext
解决办法:
$PHP_GETTEXT /usr/local /usr; do
configure文件改为
for i in $PHP_GETTEXT /usr/local /usr /usr/local/opt/gettext; do
问题五
configure: error: Please specify the install prefix of iconv with --with-iconv=
解决办法,编译参数中加上
\--with-iconv=/usr/local/Cellar/libiconv/1.15
问题六
checking for libiconv in -liconv... no
checking for iconv in -liconv... no
configure: error: Please reinstall the iconv library.
【最终卡在了这里,没解决。然后编译安装就没有成功】
最后解决到问题五的时候的编译安装命令如下:
./configure --prefix=/usr/local/php/7.2.7\—with-config-file-path=/usr/local/php/7.2.7/etc \--with-config-file-scan-dir=/usr/local/php/7.2.7/etc/conf.d \--with-apxs2=/usr/local/bin/apxs \--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--with-mysqli \--with-pdo-mysql \--with-iconv=/usr/local/Cellar/libiconv/1.15 \--with-eeeetype-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-onsnssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--without-pear \--with-gettext \--disable-fileinfo \--enable-maintnener-zts \--enable-mysqlnd
brew安装
1.搜索brew中的php
brew search php
出现了:php@5.6 php@7.1 php@7.0
2.然后安装了php7.0
brew install php70
3.将php设置系统环境变量
find / -name php # 先找到php执行文件
cp /usr/local/Cellar/php@7.0/7.0.30_1/bin/php /usr/bin # 将php执行文件放到/usr/bin/文件夹中
最后
通过源码编译安装没有成功,还是brew install安装成功
mac php7 mysql.so_[安装] mac安装PHP7经历相关推荐
- mac+php7+mysql.so_在Mac上编译安装PHP7的开发环境
今天看到鸟哥发微博说php7 beta1测试版发布了,于是赶紧就去抢先下载,把自己的开发环境也升级到PHP7去,话不多少,下面就一起来搞起吧... 首先你得去官网下载php7 beta1的版本 这里由 ...
- mac下mysql的DMG格式安装卸载方法
mac下mysql的DMG格式安装内有安装文件,却没有卸载文件--很郁闷的事. 网上搜了一下,发现给的方法原来得手动去删. 很多文章记述要删的文件不完整,后来在 stackoverflow 这里发现了 ...
- mac php7 mysql 扩展_升级到php7和安装拓展(mac centos)
Mac升级到php7 使用homebrew安装php7 brew update #更新源 brew search php #查找源中的php,发现有php7.1版本,安装最新的php7.1 brew ...
- mac上mysql.tar.gz的安装图解
本文主要讲述mac下5.6/5.7/8.0用tar.gz方式安装的mysql数据库,并晒出简单的shell脚本和执行方式,自测可以通过 主要功能点: mysql-install.sh:安装,配置环境变 ...
- mac版mysql workbench_MySQL Workbench for mac下载-MySQL Workbench for mac(数据库工具) v8.0.16特别版 - Mac天空...
MySQL Workbench提供了创建复杂RT模型,正向和反向工程或从简单且用户友好的界面执行各种管理和文档任务所需的所有必需工具.MySQL Workbench可以帮助您轻松管理,建模,生成和设计 ...
- mac 启动mysql 报错,mac 解决 mysql 启动报错
玄幻问题 mac 中用 brew 安装 mysql,理想中是这样的:执行一行命令,就可以愉快地使用 mysql 现实却是这样的:当系统曾经安装过 mysql, 用 brew 卸载后再安装新版 mysq ...
- Mac下MySQL卸载方法
2019独角兽企业重金招聘Python工程师标准>>> mac下mysql的DMG格式安装内有安装文件,却没有卸载文件--很郁闷的事. 网上搜了一下,发现给的方法原来得手动去删. 很 ...
- mac php7 mysql.so_mac下安装php7详解
本文主要为大家介绍一下mac 下安装php7全过程.具有很好的参考价值,希望对大家有所帮助.一起跟随小编过来看看吧,希望能帮助到大家. 更新系统库 yum -y install gcc gcc-c++ ...
- 在Mac上为自己手动编译安装一套PHP7的开发环境
首先你得去官网下载php7 beta1的版本 这里由于我是在mac上安装,所以就去下载linux相关的版本,地址也直接附上了 php7 beta1 windows版的官方也有发布详情猛戳:这里 解压安 ...
最新文章
- 轻断食是一种科学的减肥方法吗?
- ipcs ipcrm命令
- Redis主从复制的搭建与.哨兵.数据持久
- 河北移动引入物联网4G专网APN提升交警执法效率
- C语言程序设计 | 扫雷游戏
- python 线性回归函数_Python实现的简单线性回归算法实例分析
- 心公正白壁无瑕什么意思?_人工智能可以编写无瑕的代码后,编码会变得无用吗?
- 软考高级 真题 2016年下半年 信息系统项目管理师 综合知识
- TextView英文自动换行解决方法
- python selenium模拟浏览器操作实战(武汉大学原教务系统)
- JavaScript使用手册(一)
- Python脚本批量转换图片格式至ico
- The YARN Timeline Service v.2
- 高中计算机操作题frontpage步骤,计算机一级Frontpage操作试题
- 串口转IAP然后到APP
- 如何从Adobe Illustrator文件中提取PNG
- HTML标签之文档结构标签
- Docker 简明教程
- 【wordpress】搭建wordpress看这一篇就够了。
- LintCode领扣算法问题答案:149. 买卖股票的最佳时机