我似乎在兜圈子,试图使用 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 安装 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