简体   繁体   English

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

[英]Couldn't install php55 by brew, tried all the possible solutions

I had pre-installed php 5.4.24 when I bought my mac. 我购买Mac时已经预装了php 5.4.24。 Then with Brew I installed php 5.5.8 which was working fine. 然后用Brew我安装了PHP 5.5.8,它工作正常。 Yesterday, I wanted to install php 5.2 which I started via brew install php52. 昨天,我想安装通过brew install php52开始的php 5.2。 It gave issue- 它给了问题-

1) Configure error: freetype.h not found After I fixed that I had another issue- 1)配置错误:找不到freetype.h。修正了我的另一个问题后,

2) configure: error: GD build test failed. 2)配置:错误:GD构建测试失败。 Please check the config.log for details. 请检查config.log以获取详细信息。

Then I realised I was not able to run php 5.5.8 that I had installed before. 然后我意识到我无法运行以前安装的PHP 5.5.8。 I uninstalled it and then while re-installing: brew install php55, I had the issue: configure: error: GD build test failed. 我卸载了它,然后在重新安装时:brew install php55,我遇到了问题:配置:错误:GD构建测试失败。 Please check the config.log for details. 请检查config.log以获取详细信息。

I tried all the possible things: 我尝试了所有可能的方法:

1) Ran brew docor. 1)冲泡docor。

2) brew upgrade && brew update. 2)brew更新&& brew更新。

3) rm freetype zlib gd ..... 3)rm freetype zlib gd ...

4) brew install freetype zlib gd 4)brew install freetype zlib gd

5) Linking all of them properly. 5)正确链接所有它们。

I am not able to proceed. 我无法继续。 Please Help. 请帮忙。 Please dont ask me to do via macports or MAMP. 请不要要求我通过macports或MAMP。

config.log-> 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>`

it seem to be a php bug: 它似乎是一个PHP错误:

You can fix your configure by removing -L$GD_LIB on line 42415: 您可以通过在42415行中删除-L $ GD_LIB来修复配置:

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

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

Wasted lot of time at last I removed Brew entirely and re-installed. 最后浪费了很多时间,我完全卸下了Brew,然后重新安装。 Took hardly half an hour to fix all the dependencies. 几乎不花半个小时来修复所有依赖项。 Everything is working now. 现在一切正常。 :) :)

After running into a similar error I discovered installing the xcode command line tools resolved the error. 遇到类似错误后,我发现安装xcode命令行工具可以解决该错误。

Run the following in terminal to install: xcode-select --install 在终端中运行以下命令进行安装:xcode-select --install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM