【问题标题】:Couldn't install php55 by brew, tried all the possible solutions无法通过brew安装php55,尝试了所有可能的解决方案
【发布时间】:2014-04-04 12:40:30
【问题描述】:

我在购买 mac 时已经预装了 php 5.4.24。然后使用 Brew 我安装了运行良好的 php 5.5.8。昨天,我想安装我通过 brew install php52 开始的 php 5.2。它给出了问题-

1) 配置错误:freetype.h not found 在我解决了另一个问题之后-

2) 配置:错误:GD 构建测试失败。详情请查看 config.log。

然后我意识到我无法运行我之前安装的 php 5.5.8。我卸载了它,然后在重新安装时:brew install php55,我遇到了问题: 配置:错误:GD 构建测试失败。详情请查看 config.log。

我尝试了所有可能的事情:

1) Ran brew docor。

2) 冲泡升级 && 冲泡更新。

3) rm freetype zlib gd .....

4) brew install freetype zlib gd

5) 正确链接所有这些。

我无法继续。请帮忙。 请不要让我通过 macports 或 MAMP 进行操作。

config.log->

`$ ./configure --prefix=/usr/local/Cellar/php55/5.5.11 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.5 --with-config-file-path=/usr/local/etc/php/5.5 --with-config-file-scan-dir=/usr/local/etc/php/5.5/conf.d --with-iconv-dir=/usr --enable-dba --with-ndbm=/usr --enable-exif --enable-soap --enable-wddx --enable-ftp --enable-sockets --enable-zip --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbstring --enable-mbregex --enable-bcmath --enable-calendar --with-zlib=/usr/local/opt/zlib --with-ldap --with-ldap-sasl=/usr --with-xmlrpc --with-kerberos=/usr --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr/local/opt/freetype --with-jpeg-dir=/usr/local/opt/jpeg --with-png-dir=/usr/local/opt/libpng --with-gettext=/usr/local/opt/gettext --with-snmp=/usr --with-libedit --with-unixODBC=/usr/local/opt/unixodbc --with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc --mandir=/usr/local/Cellar/php55/5.5.11/share/man --with-mhash --with-curl --with-bz2=/usr --disable-debug --with-openssl=/usr --with-xsl=/usr --with-apxs2=/usr/sbin/apxs --libexecdir=/usr/local/Cellar/php55/5.5.11/libexec --with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --enable-pcntl --enable-zend-signals --enable-dtrace --enable-opcache

## --------- ##
## Platform. ##
## --------- ##

hostname = Subham-Khandelwal.local
uname -m = x86_64
uname -r = 13.1.0
uname -s = Darwin
uname -v = Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
         Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 8.00 gigabytes
Default processor set: 218 tasks, 1116 threads, 4 processors
Load average: 4.00, Mach factor: 0.93
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/Library/ENV/4.3
PATH: /usr/local/opt/libpng/bin
PATH: /usr/local/opt/freetype/bin
PATH: /usr/local/opt/gettext/bin
PATH: /usr/local/opt/jpeg/bin
PATH: /usr/local/opt/unixodbc/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin

## ----------- ##
## Core tests. ##
## ----------- ##
::
::
configure:4184: result: yes
configure:4193: checking whether clang accepts -g
configure:4213: clang -c -g  conftest.c >&5
configure:4213: $? = 0
configure:4254: result: yes
configure:4271: checking for clang option to accept ISO C89
configure:4334: clang  -c -g -O2  conftest.c >&5
configure:4334: $? = 0
configure:4347: result: none needed
configure:4373: checking how to run the C preprocessor
configure:4404: clang -E  conftest.c
configure:4404: $? = 0
configure:4418: clang -E  conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>


1 error generated.
configure:4418: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4443: result: clang -E
configure:4463: clang -E  conftest.c
configure:4463: $? = 0
configure:4477: clang -E  conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^
1 error generated.
configure:4477: $? = 1
configure: failed program was:
| /* confdefs.h */

| #define PACKAGE_NAME ""

| #define PACKAGE_TARNAME ""

| #define PACKAGE_VERSION ""

| #define PACKAGE_STRING ""

| #define PACKAGE_BUGREPORT ""

| #define PACKAGE_URL ""

| /* end confdefs.h.  */

| #include <ac_nonexistent.h>

configure:4508: checking for icc

configure:4517: result: no
::
::
conftest.c:52:10: fatal error: 'minix/config.h' file not found
#include <minix/config.h>

conftest.c:58:10: fatal error: 'sys/pstat.h' file not found
#include <sys/pstat.h>

::
configure:10853: clang -o conftest -g -O2 -fvisibility=hidden  -no-cpp-precomp  conftest.c  >&5

conftest.c:26:10: fatal error: 'sys/exec.h' file not found

include <sys/exec.h>`

【问题讨论】:

  • config.log 说了什么?
  • 不知道在哪里,能告诉我config.log的位置吗?
  • ~/Library/Logs/Homebrew/config.log.&lt;formula&gt;.&lt;timestamp&gt; ?
  • @Samoth 我已经在上面添加了我的日志文件,请看一下.. 谢谢..
  • 请问您运行的是哪个版本的 OS X?

标签: php macos installation homebrew


【解决方案1】:

这似乎是一个 php 错误:

您可以通过删除第 42415 行的 -L$GD_LIB 来修复您的配置:

-LIBS="-L$GD_LIB $GD_SHARED_LIBADD $LIBS" +LIBS="$GD_SHARED_LIBADD $LIBS"

https://bugs.php.net/bug.php?id=41555

【讨论】:

    【解决方案2】:

    浪费了很多时间,最后我完全删除了 Brew 并重新安装。几乎花了半个小时来修复所有依赖项。现在一切正常。 :)

    【讨论】:

      【解决方案3】:

      在遇到类似错误后,我发现安装 xcode 命令行工具解决了该错误。

      在终端运行以下命令进行安装: xcode-select --install

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-04-20
        • 2014-09-28
        • 2019-08-16
        • 2018-06-24
        • 1970-01-01
        • 2015-02-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多