PHPBrew:无法安装php或安装openssl扩展

时间:2016-10-22 13:43:33

标签: php ubuntu-16.04 windows-subsystem-for-linux phpbrew

我似乎在试图使用phpbrew安装一个版本的php。在尝试安装任何版本的php时,它会返回致命错误:

  

找不到openssl扩展名,下载发布文件需要openssl

但是当我尝试通过phpbrew安装openssl时,它也会抛出错误说:

  

错误:未定义PHPBREW_PHP环境变量。此扩展命令要求您从构建列表中指定PHP版本。

非常感谢任何帮助。

命令&输出

phpbrew --debug install php-5.6.18 + default

引发此错误:

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

1 个答案:

答案 0 :(得分:1)

这可能是.phpbrew文件夹权限的问题。它位于Ubuntu的/ home。

你可以快速而又肮脏:

sudo chmod -R 777 ~/.phpbrew/

进行生产是不可接受的,但您在开发机器上可能是安全的。