osx - Mac os x 下使用homebrew安装PHP56失败

php中文网
发布: 2016-06-06 20:38:44
原创
1187人浏览过

<code>➜  ~ git:(master) ✗ brew install php56
==> Installing php56 from homebrew/homebrew-php
==> Downloading https://www.php.net/get/php-5.6.4.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php56-5.6.4
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
         of homebrew-php, or you are using a non-standard
         pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php56/5.6.4 --localstatedir=/usr/loca
==> make
/private/tmp/php56-uHXcTe/php-5.6.4/sapi/apache2handler/sapi_apache2.c:41:10: fatal error: 'ap_config.h' file not found#include "ap_config.h"
         ^
1 error generated.
make: *** [sapi/apache2handler/sapi_apache2.lo] Error 1

READ THIS: http://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/homebrew/homebrew-php/issues
</code>
登录后复制

然后上 https://github.com/homebrew/homebrew/blob/master/share/doc/homebrew/troubleshooting.md#troubleshooting 查阅了资料,无法解决问题


<code>**➜  ~ git:(master) ✗ brew doctor
Your system is ready to brew.**
</code>
登录后复制

通过运行brew doctor自检,homebrew没发现问题


<code>➜  ~ git:(master) ✗ brew gist-logs
usage: brew gist-logs [--new-issue|-n] <formula>
➜  ~ git:(master) ✗ brew gist-logs https://github.com/Homebrew/homebrew-apache.git
</code>
登录后复制

然后怀疑是 apache 出现问题,直接通过 `homebrew-apache 尝试下载,无效

Codeium
Codeium

一个免费的AI代码自动完成和搜索工具

Codeium 228
查看详情 Codeium

<code>######################################################################## 100.0%
Error: /Library/Caches/Homebrew/Formula/homebrew-apache.git:5: syntax error, unexpected '<'
<!DOCTYPE html>
 ^
/Library/Caches/Homebrew/Formula/homebrew-apache.git:6: syntax error, unexpected '<'
<html lang="en" class="">
 ^
/Library/Caches/Homebrew/Formula/homebrew-apache.git:6: syntax error, unexpected keyword_class, expecting end-of-input
<html lang="en" class="">
                     ^
Please report this bug:
    http://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formulary.rb:92:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:92:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:151:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:82:in `klass'
/usr/local/Library/Homebrew/formulary.rb:71:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:200:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `block in formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `formulae'
/usr/local/Library/Homebrew/cmd/gist-logs.rb:127:in `gist_logs'
/usr/local/Library/brew.rb:135:in `<main>'
➜  ~ git:(master) ✗
</code>
登录后复制

<code>➜  ~ git:(master) ✗ sudo apachectl -v
Password:
Server version: Apache/2.4.9 (Unix)
Server built:   Sep  9 2014 14:48:20
➜  ~ git:(master) ✗
</code>
登录后复制

查询了Apache,看起来没问题啊实在不知道问题出现在哪里了


参考资料

立即学习PHP免费学习笔记(深入)”;

参考资料2error freetype.h not found installing php53 #885

回复内容:

<code>➜  ~ git:(master) ✗ brew install php56
==> Installing php56 from homebrew/homebrew-php
==> Downloading https://www.php.net/get/php-5.6.4.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php56-5.6.4
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
         of homebrew-php, or you are using a non-standard
         pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php56/5.6.4 --localstatedir=/usr/loca
==> make
/private/tmp/php56-uHXcTe/php-5.6.4/sapi/apache2handler/sapi_apache2.c:41:10: fatal error: 'ap_config.h' file not found#include "ap_config.h"
         ^
1 error generated.
make: *** [sapi/apache2handler/sapi_apache2.lo] Error 1

READ THIS: http://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/homebrew/homebrew-php/issues
</code>
登录后复制

然后上 https://github.com/homebrew/homebrew/blob/master/share/doc/homebrew/troubleshooting.md#troubleshooting 查阅了资料,无法解决问题


<code>**➜  ~ git:(master) ✗ brew doctor
Your system is ready to brew.**
</code>
登录后复制

通过运行brew doctor自检,homebrew没发现问题


<code>➜  ~ git:(master) ✗ brew gist-logs
usage: brew gist-logs [--new-issue|-n] <formula>
➜  ~ git:(master) ✗ brew gist-logs https://github.com/Homebrew/homebrew-apache.git
</code>
登录后复制

然后怀疑是 apache 出现问题,直接通过 `homebrew-apache 尝试下载,无效


<code>######################################################################## 100.0%
Error: /Library/Caches/Homebrew/Formula/homebrew-apache.git:5: syntax error, unexpected '<'
<!DOCTYPE html>
 ^
/Library/Caches/Homebrew/Formula/homebrew-apache.git:6: syntax error, unexpected '<'
<html lang="en" class="">
 ^
/Library/Caches/Homebrew/Formula/homebrew-apache.git:6: syntax error, unexpected keyword_class, expecting end-of-input
<html lang="en" class="">
                     ^
Please report this bug:
    http://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formulary.rb:92:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:92:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:151:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:82:in `klass'
/usr/local/Library/Homebrew/formulary.rb:71:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:200:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `block in formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `formulae'
/usr/local/Library/Homebrew/cmd/gist-logs.rb:127:in `gist_logs'
/usr/local/Library/brew.rb:135:in `<main>'
➜  ~ git:(master) ✗
</code>
登录后复制

<code>➜  ~ git:(master) ✗ sudo apachectl -v
Password:
Server version: Apache/2.4.9 (Unix)
Server built:   Sep  9 2014 14:48:20
➜  ~ git:(master) ✗
</code>
登录后复制

查询了Apache,看起来没问题啊实在不知道问题出现在哪里了


参考资料

立即学习PHP免费学习笔记(深入)”;

参考资料2error freetype.h not found installing php53 #885

推荐PHPBrew

osx - Mac os x 下使用homebrew安装PHP56失败

还是采用homebrew下的命令

相关标签:
php
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号