【问题标题】:PHPBrew - various problems with installationPHPBrew - 安装的各种问题
【发布时间】:2016-10-23 02:19:00
【问题描述】:

我正在尝试使用 PHPBrew 安装 PHP 5.4,但出现了这些错误:

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

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

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

【问题讨论】:

    标签: php linux phpbrew


    【解决方案1】:

    我看起来你缺少一些依赖项。

    先尝试安装 ssl dev 包:

    apt-get install libssl-dev
    

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

    编辑:

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

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

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

    【讨论】:

    • -> % sudo apt-get install libssl-dev Reading package lists... Done Building dependency tree Reading state information... Done libssl-dev 已经是最新版本(1.0.2h-1 +deb.sury.org~xenial+1)。 0 个已升级,0 个新安装,0 个要移除,40 个未升级。
    【解决方案2】:

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

    +openssl=/usr -- --with-libdir=lib64
    

    【讨论】:

    • 使用此解决方案我有:检查 Kerberos 支持...不检查 -lssl 中的 DSA_get_default_method...不检查 -lcrypto 中的 X509_free...是检查 pkg-config。 .. /usr/bin/pkg-config 配置:错误:找不到 OpenSSL 的库
    • 你能粘贴整个构建日志,而不仅仅是最后 10 行,包括配置命令吗?
    【解决方案3】:
    configure: error: Cannot find OpenSSL's <evp.h>
    

    如果您安装的 OpenSSL 版本比您提供的发行版更新,则可能会发生此问题。

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

    #file etc/apt/preferences.d/allow-downgrade
    
    Package: *
    Pin: release o=Ubuntu
    Pin-Priority: 1001
    

    然后

    sudo apt-get update 
    sudo apt-get upgrade
    

    和选项

     -- --with-openssl=/path/to/libs 
    

    +openssl
    

    应该可以正常工作。

    如果您已经从 PHPbrew 安装了一些功能错误的 PHP,请不要忘记使用

    进行切换
    phpbrew switch recently_installed_php_ver_number_here
    

    【讨论】:

      【解决方案4】:

      在 Ubuntu 16.10 上

      sudo apt-get install libssl-dev
      sudo apt-get install libcurl4-openssl-dev
      sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev
      

      然后重新运行

      phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-03-04
        • 1970-01-01
        • 2011-06-23
        • 2019-02-12
        • 2018-09-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多