首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHPBrew -安装的各种问题

PHPBrew -安装的各种问题
EN

Stack Overflow用户
提问于 2016-06-21 21:37:18
回答 4查看 2.4K关注 0票数 2

我正在尝试用PHPBrew安装PHP5.4,但是出现了这些错误:

代码语言:javascript
复制
-> % phpbrew install 5.4.6 +default +apxs2 +mysql                              
===> phpbrew will now build 5.4.6
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e
===> Distribution file was successfully extracted, skipping...
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/home/breq/.phpbrew/build/php-5.4.6' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
0 changes patched.
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466515643
===> Configuring 5.4.6...


Use tail command to see what's going on:
   $ tail -F /home/breq/.phpbrew/build/php-5.4.6/build.log


===> Checking patches...
Checking patch for php5.3.29 multi-sapi patch.
Checking patch for php5.3.x on 64bit machine when intl is enabled.
Checking patch for openssl dso linking patch
===> Building...
Error: Make failed:
The last 5 lines in the log file:
/home/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:355: undefined reference to `SSLv3_server_method'

/home/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:343: undefined reference to `SSLv3_client_method'

collect2: error: ld returned 1 exit status

Makefile:244: recipe for target 'sapi/cli/php' failed

make: *** [sapi/cli/php] Error 1

Please checkout the build log file for more details:
     tail /home/breq/.phpbrew/build/php-5.4.6/build.log

使用+openssl

代码语言:javascript
复制
-> % phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl
===> phpbrew will now build 5.4.6
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e
===> Distribution file was successfully extracted, skipping...
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/home/breq/.phpbrew/build/php-5.4.6' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
0 changes patched.
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466516015
===> Configuring 5.4.6...


Use tail command to see what's going on:
   $ tail -F /home/breq/.phpbrew/build/php-5.4.6/build.log


Error: Configure failed:
The last 5 lines in the log file:
checking for Kerberos support... no

checking for DSA_get_default_method in -lssl... no

checking for X509_free in -lcrypto... yes

checking for pkg-config... /usr/bin/pkg-config

configure: error: Cannot find OpenSSL's <evp.h>

Please checkout the build log file for more details:
     tail /home/breq/.phpbrew/build/php-5.4.6/build.log

我的操作系统:Xubuntu 16.10 + PHP 7.07

代码语言:javascript
复制
-> % tail /home/lmalicki/.phpbrew/build/php-5.4.6/build.log
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... yes
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
EN

回答 4

Stack Overflow用户

发布于 2016-06-21 21:51:00

我看起来你遗漏了一些依赖项。

先尝试安装ssl dev包:

代码语言:javascript
复制
apt-get install libssl-dev

PHPBrew只是下载并编译php,但它不会在你的操作系统中安装所需的依赖项。

编辑:

我刚刚注意到您在+openssl=/usr/include/openssl中为openssl库提供了路径。

你确定它在那里吗?你可以用which openssl检查一下。此命令将返回openssl二进制文件的路径。

此外,您可以尝试简单地删除路径,因为PHPBrew应该自己找到合适的二进制文件。

票数 0
EN

Stack Overflow用户

发布于 2016-06-21 23:39:42

由于+openssl指令实际上提供的是前缀而不是包含路径,请尝试

代码语言:javascript
复制
+openssl=/usr -- --with-libdir=lib64
票数 0
EN

Stack Overflow用户

发布于 2016-07-03 06:11:17

代码语言:javascript
复制
configure: error: Cannot find OpenSSL's <evp.h>

如果您安装的OpenSSL版本高于所提供的发行版,则可能会发生此问题。

如果你使用ubuntu,你可能需要降级你的软件包。(但您可能出于某种原因安装了不同的版本,因此在这里要小心)

代码语言:javascript
复制
#file etc/apt/preferences.d/allow-downgrade

Package: *
Pin: release o=Ubuntu
Pin-Priority: 1001

然后

代码语言:javascript
复制
sudo apt-get update 
sudo apt-get upgrade

和选项

代码语言:javascript
复制
 -- --with-openssl=/path/to/libs 

代码语言:javascript
复制
+openssl

应该可以很好地工作。

如果您已经从PHPbrew安装了一些运行不正常的PHP,不要忘了切换到

代码语言:javascript
复制
phpbrew switch recently_installed_php_ver_number_here
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37946026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档