【报错1】

./configure 时报错

conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found

【解决】

再次升级到最新的苹果系统 OS Sierra 10.12.1

【报错2】

configure: error: Cannot find libz

【试着解决】

执行 sudo brew install libz,继续报错:

【报错3】

Error: No available formula with the name "libz" ==> Searching for similarly named formulae... These similarly named formulae were found: libzdb libzip libzzip To install one of them, run (for example): brew install libzdb ==> Searching taps... Error: No formulae found in taps. ==> You haven't updated Homebrew in a while. A formula for libz might have been added recently. Run brew update to get the latest Homebrew updates!

按照提示,执行 brew update,继续报错:

【报错4】

/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory /usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory [etc..] Error: update-report should not be called directly!

参考国外的网站,homebrew-error-update-report-should-not-be-called-directly

【解决】

1 cd /usr/local; git reset --hard origin/master; brew update 继续执行,brew update,继续报错:

【报错5】

Error: /usr/local must be writable!

执行 sudo brew update,继续报错:

【报错6】

Error: Cowardly refusing to 'sudo brew update' You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.

好吧,修改 /usr/local/ 文件夹的权限(用户)

sudo chown -R $(whoami) /usr/local

再次执行 brew update,这条语句没报错!

继续解决 Cannot find libz 的问题,执行: brew install libz,报错

【报错7】

Error: No available formula with the name "libz" ==> Searching for similarly named formulae... These similarly named formulae were found: libzdb libzip libzzip To install one of them, run (for example): brew install libzdb ==> Searching taps... Error: No formulae found in taps.

后来,找到一个帖子,Cannot find libz when install php56,找到解决方案

【解决】

执行

1 2 xcode-select --install brew upgrade PHP-5.6 继续执行,./configure ,没报错!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ./configure --prefix=/usr/local/php/php-5.6 --with-config-file-path=/usr/local/php/php-5.6/etc --with-openssl=/usr/local/opt/openssl --with-zlib --with-bz2 --with-gd --with-jpeg-dir --with-png-dir --with-gettext --with-mhash --with-freetype-dir --with-mcrypt --with-iconv --with-curl --with-xmlrpc --with-mysql --with-pdo-mysql --with-mysqli --enable-calendar --enable-pdo --enable-zip --enable-mbstring --enable-mbregex --enable-bcmath --enable-soap --enable-sockets --enable-ftp --enable-gd-native-ttf --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-xml --enable-pcntl --enable-fpm --enable-opcache --without-pear PHP-7.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ./configure --prefix=/usr/local/php/php-7.0 --with-config-file-path=/usr/local/php/php-7.0/etc --with-openssl=/usr/local/opt/openssl --with-zlib --with-bz2 --with-gd --with-jpeg-dir --with-png-dir --with-gettext --with-mhash --with-freetype-dir --with-mcrypt --with-iconv --with-curl --with-xmlrpc --with-pdo-mysql --with-mysqli --enable-calendar --enable-pdo --enable-zip --enable-mbstring --enable-mbregex --enable-bcmath --enable-soap --enable-sockets --enable-ftp --enable-gd-native-ttf --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-xml --enable-pcntl --enable-fpm --enable-opcache --without-pear 执行 make 的时候会报错,参考 以前的文章,即可解决:

Mac Pro 编译安装 PHP 5.6.21 及 问题汇总

执行 make 操作的时候,又报错:

/usr/lib/libiconv.dylib /usr/local/lib/libiconv.dylib -o sapi/cli/php ld: can't write output file: sapi/cli/php for architecture x86_64

提示不能写入,应该是权限的问题,进入源码包的,查看文件 ./sapi/cli/php 文件,所属用户为 root,果然是权限问题,执行 make 的时候,sudo 一下,即 sudo make,大功告成

php php_sapi cli,php_sapi_name() cli相关推荐

  1. 2.安装 CLI和CLI的工作原理

    转自:https://www.gruntjs.net/getting-started 还在使用 Grunt 0.3 版本吗?请查看 Grunt 0.3 注意事项 在继续学习前,你需要先将Grunt命令 ...

  2. 七、Vue cli详解学习笔记——什么是Vue cli ,Vue cli的使用(安装,拉取2.x模板,初始化项目),Vue cli2详解,Runtime-Compiler和Runtime-only区别

    一.什么是Vue CLI 如果你只是简单写几个Vue的Demo程序, 那么你不需要Vue CLI. 如果你在开发大型项目, 那么你需要, 并且必然需要使用Vue CLI 使用Vue.js开发大型应用时 ...

  3. 获取当前PHP运行环境是否cli模式

    需要用到系统函数php_sapi_name() 或者 系统常量 PHP_SAPI,返回 cli 或 cli_server 1 /* 2 判断当前的运行环境是否是cli模式 3 */ 4 functio ...

  4. php运行方式fpm fcgi,php如何从fpm-fcgi切换运行模式到cli

    在使用一个php爬虫的时候提示一定要用cli环境 我查看了当前php版本信息如下: 我打印 PHP_SAPI 显示 fpm-fcgi 如何才能变成 cli 服务器环境是linux+nginx 补充:我 ...

  5. VSCode 搭建Vue开发环境之Vue CLI

    2019独角兽企业重金招聘Python工程师标准>>> 一.简介说明 1.关于VS Code开发工具,安装和配置,更多可以参考以前文章 2.关于Vue.js,Vue是一个优秀的渐进式 ...

  6. commons-io_从Commons CLI迁移到picocli

    commons-io 最初于2002年发布的Apache Commons CLI可能是使用最广泛的Java命令行解析器,但是它的API显示了它的年龄. 寻找具有最少样板代码的现代方法的应用可能对pic ...

  7. 什么是.Net, IL, CLI, BCL, FCL, CTS, CLS, CLR, JIT

    什么是.NET? 起源:比尔盖茨在2000年的Professional Developers Conference介绍了一个崭新的平台叫作Next Generation Windows Service ...

  8. go实现命令行的工具cli

    A simple, fast, and fun package for building command line apps in Go 详见:https://github.com/urfave/cl ...

  9. Go语言命令行库urfave/cli简介

    很多用Go写的命令行程序都用了urfave/cli这个库,包括geth,有必要简单了解一下. 用C写过命令行程序的人应该都不陌生,我们需要根据argc/argv一个个地解析命令行参数,调用不同的函数, ...

最新文章

  1. 编译器架构Compiler Architecture(上)
  2. LeetCode Copy List with Random Pointer
  3. Loadrunner无法打开浏览器的相关问题
  4. python中with的用法
  5. 如何使用Angular的@Input()装饰器
  6. java.net.SocketException: Software caused connection abort: socket write erro
  7. 讯飞输入法有没有Linux,Debian testing 安装讯飞输入法 - Linux系统与应用 - LinuxApp - 水木社区...
  8. 唯一索引与主键索引的比较
  9. 一份完整的问卷模板_如何写出一份优秀的个人简历?
  10. mysql time转换输出_MySQL将timediff输出转换为日,时,分,秒格式?
  11. vue 表单 input checkbox
  12. mysql被跑死_MySQL 8.0.23中复制架构从节点自动故障转移
  13. 【073】Android 数据存储(SQLite)
  14. 【图像增强】基于matlab同态滤波+Retinex+模糊技术图像增强【含Matlab源码 1013期】
  15. stm32车牌识别_道路千万条,方案这一条,带你深入了解车牌号识别系统
  16. 使用DAEMON Tools Ultra制作Ubuntu启动U盘全过程(含图文)
  17. Android Q 上的Biometric生物识别之Fingerprint指纹识别流程
  18. 有一种爱 不能称之为爱情
  19. Dynamics CRM 中 Xrm.Page.getControl('name').getValue() 和 Xrm.Page.getAttribute('name').getValue() 的区别
  20. 华为智慧办公全系列终端介绍

热门文章

  1. python在电力系统中的应用_SKIDL: 在PYTHON中描述你的电路
  2. 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛 个人笔记 题解
  3. 微软一站式示例代码库(中文版)2012-2-10版本, 新添加ASP.NET, Windows Form, VSX, Windows Shell, WPF等16个Sample
  4. CAST 和 CONVERT
  5. 总结:MUSTer中的keypoint matching以及利用RANSAC去除outliers
  6. Unity分屏显示效果
  7. 《软技能·代码之外的生存指南》读书笔记 ——自我营销
  8. WEB测试番外之----XSS攻击
  9. gdal gdal2tiles.py 的使用
  10. eclipse neon Java编辑器页面字体更改