无法通过brew安装php55,尝试了所有可能的解决方案

时间:2014-04-04 12:40:31

标签: php macos install homebrew

当我买了我的mac时,我已经预装了php 5.4.24。然后用Brew我安装了PHP 5.5.8,它工作正常。昨天,我想安装php 5.2,我是通过brew install php52启动的。它给出了问题 -

1)配置错误:找不到freetype.h 在我修复之后我又遇到了另一个问题 -

2)configure:错误:GD构建测试失败。请查看config.log以获取详细信息。

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

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

1)Ran brew docor。

2)brew升级&& brew更新。

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>`

3 个答案:

答案 0 :(得分:0)

它似乎是一个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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

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

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