簡體   English   中英

PHPBrew:無法安裝php或安裝openssl擴展

[英]PHPBrew: cannot install php or install openssl extension

我似乎無所事事,試圖使用phpbrew安裝php版本。 嘗試安裝任何版本的php時,都會返回致命錯誤:

找不到openssl擴展名,要下載發布文件,您需要openssl

但是,當我嘗試通過phpbrew安裝openssl時,它還會拋出一條錯誤消息:

錯誤:未定義PHPBREW_PHP環境變量。 此擴展命令要求您從構建列表中指定一個PHP版本。

任何幫助將非常感激。

命令與輸出

phpbrew --debug安裝php-5.6.18 +默認

引發此錯誤:

WARNING: curl extension might be required for fetching data.
Exception: openssl extension not found, to download releases file you need openssl.
Thrown from phar:///usr/bin/phpbrew/src/PhpBrew/ReleaseList.php at line 163:

  160    private static function downloadReleaseListFromOfficialSite($version, OptionResult $options = null)
  161    {
  162        if (!extension_loaded('openssl')) {
> 163            throw new Exception(
  164                'openssl extension not found, to download releases file you need openssl.');
  165        }
  166
  167        $max = ($options && $options->old) ? 1000 : 100;

Trace:
    0) PhpBrew\ReleaseList::downloadReleaseListFromOfficialSite(7, GetOptionKit\OptionResult)
        from phar:///usr/bin/phpbrew/src/PhpBrew/ReleaseList.php: 179
    1) PhpBrew\ReleaseList::buildReleaseListFromOfficialSite(GetOptionKit\OptionResult)
        from phar:///usr/bin/phpbrew/src/PhpBrew/ReleaseList.php: 136
    2) PhpBrew\ReleaseList->fetchRemoteReleaseList(GetOptionKit\OptionResult)
        from phar:///usr/bin/phpbrew/src/PhpBrew/ReleaseList.php: 154
    3) PhpBrew\ReleaseList::getReadyInstance(GetOptionKit\OptionResult)
        from phar:///usr/bin/phpbrew/src/PhpBrew/Command/InstallCommand.php: 182
    4) PhpBrew\Command\InstallCommand->execute('php-5.3.10', '+default')
        from : 0
    5) call_user_func_array([PhpBrew\Command\InstallCommand, 'execute'], ['php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/vendor/corneltek/cliframework/src/CommandBase.php: 845
    6) CLIFramework\CommandBase->executeWrapper(['php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/vendor/corneltek/cliframework/src/Application.php: 398
    7) CLIFramework\Application->run(['/usr/bin/phpbrew', '--debug', 'install', 'php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/src/PhpBrew/Console.php: 111
    8) PhpBrew\Console->runWithTry(['/usr/bin/phpbrew', '--debug', 'install', 'php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php: 2
    9) require('phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php')
        from /usr/bin/phpbrew: 99

phpbrew --debug ext安裝openssl

引發此錯誤:

# WARNING: curl extension might be required for fetching data.
Error: PHPBREW_PHP environment variable is not defined.
  This extension command requires you specify a PHP version from your build list.
  And it looks like you haven't switched to a version from the builds that were built with PHPBrew.
Suggestion: Please install at least one PHP with your prefered version and switch to it.

平台

操作系統:Ubuntu 16.04(適用於Linux的Windows子系統)

正在運行PHP:尚無,無法安裝。

安裝PHP:phpbrew上任何版本的php

.phpbrew文件夾的權限可能有問題。 它位於Ubuntu的/ home中。

您可以快速又臟地進行此操作:

sudo chmod -R 777 ~/.phpbrew/

在生產中這樣做是不可接受的,但是在開發機器上您可能是安全的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM