PHPBrew: cannot install php or install openssl extension
<p>I seem to be running around in circles trying to install a version of php using phpbrew. When trying to install any version of php it returns a fatal error: </p>

<blockquote>
  <p><strong>openssl extension not found, to download releases file you need openssl</strong>. </p>
</blockquote>

<p>But when I try install openssl via phpbrew it also throws an error saying: </p>

<blockquote>
  <p><strong>Error: PHPBREW_PHP environment variable is not defined. This extension command requires you specify a PHP version from your build list.</strong></p>
</blockquote>

<p>Any help would be much appreciated.</p>

<h3>Commands &amp; Output</h3>

<p><strong>phpbrew --debug install php-5.6.18 +default</strong></p>

<p>Throws this error:</p>

<pre><code>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')) {
&gt; 163            throw new Exception(
  164                'openssl extension not found, to download releases file you need openssl.');
  165        }
  166
  167        $max = ($options &amp;&amp; $options-&gt;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-&gt;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-&gt;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-&gt;executeWrapper(['php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/vendor/corneltek/cliframework/src/Application.php: 398
    7) CLIFramework\Application-&gt;run(['/usr/bin/phpbrew', '--debug', 'install', 'php-5.3.10', '+default'])
        from phar:///usr/bin/phpbrew/src/PhpBrew/Console.php: 111
    8) PhpBrew\Console-&gt;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
</code></pre>

<p><strong>phpbrew --debug ext install openssl</strong></p>

<p>Throws this error: </p>

<pre><code># 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.
</code></pre>

<h3>Platform</h3>

<p>OS: Ubuntu 16.04 (Windows Sub-system for linux)</p>

<p>Running PHP: 
None yet, cannot install.</p>

<p>Installing PHP:
Any version of php on phpbrew</p>