[安装] 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=<DIR>
解决办法,编译参数中加上
\--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安装成功
原文地址:https://segmentfault.com/a/1190000015670210
[安装] mac安装PHP7经历的更多相关文章
- Mac安装LNMP环境,升级php7
Mac安装nginx+mysql+php 安装nginx比较麻烦,要安装pcre ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre ...
- PHP、mySQL及Navicat安装·Mac
PHP配置 Mac系统对开发人员非常友好,除了自带Apache外,还带有能与Apache相匹配的服务器端脚本语言PHP,因此,Mac中PHP的启动只需要在Apache服务中进行一下超级简单的配置即可直 ...
- Mac安装Homebrew的那些事儿
Mac安装Homebrew的那些事儿 最近小明刚换置了一个 Mac 本,想搭建一个属于自己的博客网站,需要用到 Node.js 环境,而Node.js 在 MacOS 中是由 Homebrew 进行安 ...
- Mac安装PHP(Homebrew/php弃用、其他第三方tap也已经弃用或者迁移后的安装配置方案)
一.前言 看网上很多资料,大多数都是 mac安装php,只需要: brew tap homebrew/php brew install phpXX 安装php扩展只需要: brew install p ...
- 史上最详细mac安装Qt教程
史上最详细mac安装Qt教程,小白看过来! 这是一篇非常适合Qt入门小白的的安装Qt教程,因为这学期我们小组的一个关于高速救援的项目要用到Qt与web进行交互式展现相关的图像,由于没有MSVC这个插件 ...
- Mac 安装WordPress
Mac 安装WordPress 一.环境要求 PHP 5.2.4或更新版本 MySQL 5.0或更新版本 WebServer(可以选择Apache.nginx等支持PHP的,这里我选择Apache) ...
- VMWare 安装 Mac OS X10.10 Yosemite
OS X Yosemite 新功能特性 Mac OS X10.10 GM3|OS X 10.10 Yosemite 正式版下载 如何在虚拟机中安装苹果mac系统图示说明 vm10虚拟机安装Mac OS ...
- mac安装tensorflow报错
问题:mac安装tensorflow过程中,爆出oserror:permission denied 解决方案:关闭mac的sip,然后sudo安装 关闭sip的方法:重启mac,按住command+R ...
- Mac 安装activate-power-mode atom
Mac 安装activate-power-mode atom 标签: atommac 2015-12-02 14:53 308人阅读 评论(0) 收藏 举报 分类: git(2) 版权声明:本文为 ...
随机推荐
- P2210 Haywire(A*)
P2210 Haywire 题目描述 Farmer John有N只奶牛,(4 <= N <= 12,其中N是偶数). 他们建立了一套原生的系统,使得奶牛与他的朋友可以通过由干草保护的线路来 ...
- element-ui公用模态框自定义样式与scoped样式生效问题解决方案
//先插如效果图 里面内容均为传进来的.包括取消与确定按钮,因为每个页面的绑定事件不一样. //下面这个图片为初始样式 //拖动模态框指令需要插件.详情看我下一篇,以下是地址 https://www. ...
- 【SpringCloud构建微服务系列】使用Spring Cloud Config统一管理服务配置
一.为什么要统一管理微服务配置 对于传统的单体应用而言,常使用配置文件来管理所有配置,比如SpringBoot的application.yml文件,但是在微服务架构中全部手动修改的话很麻烦而且不易维护 ...
- 如何实现Docker镜像和容器实例的备份迁移
题记 大家在使用Docker都会从容器仓库下载镜像,不过这个过程可能依据网络带宽而定,那么如果将一个已经下载好的镜像迁移到另外一个环境中,或者说如何实现Docker容器的备份恢复,或者迁移,接下来我们 ...
- New Article For Test
\[ a ^ 2 + b ^ 2 ~-~ 2 \times a \times b \times cos~ \theta = c ^ 2 \] #include<stdio.h> int m ...
- C++默认函数与函数重载
一.默认参数 在C++中,可以为参数指定默认值.在函数调用时没有指定与形参相对应的实参时, 就自动使用默认参数. 默认参数的语法与使用:(1)在函数声明或定义时,直接对参数赋值.这就是默认参数: (2 ...
- 如何向妻子解释OOD (转)
此文译自CodeProject上<How I explained OOD to my wife>一文,该文章在Top Articles上排名第3,读了之后觉得非常好,就翻译出来,供不 ...
- XCode的debug断点调试
debug 流程控制 当你通过 Xcode 的源码编辑器的侧边槽 (或者通过下面的方法) 插入一个断点,程序到达断点时会就会停止运行. 调试条上会出现四个你可以用来控制程序的执行流程的按钮. 从左到右 ...
- jboss中JVM监控
1)打开 http://server-name-or-ip/jmx-console/HtmlAdaptor2)在 jboss.system 节点找到 type=ServerInfo ,点击进入3)找到 ...
- [Windows Server 2008] 搭建数据云备份
★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com ★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频. ★ 本节我们将带领大家:如何搭建数 ...