Phpbrew: how to disable phpbrew connect pecl

Created on 22 Nov 2016  ยท  5Comments  ยท  Source: phpbrew/phpbrew

Output

โ˜  ~  phpbrew ext enable xdebug
PHP Warning:  file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Operation timed out in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Operation timed out in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
===> Enabling extension xdebug
[*] xdebug extension is enabled.

How to disable phpbrew connecting pecl.php.net? When I enable/disable extensions, phpbrew try to connect pecl.php.net, even the extension is already installed, that's waste too much time; and when I'm offline, it makes error.

Bug Extension Installer

Most helpful comment

hi @mirfilip @0captain I will take a look at this issue when I have time. thanks for reporting this.

All 5 comments

I'm on the same boat. I'm using phpbrew to preconfigure the machine that later has no internet connectivity. What is the reasoning behind calling pecl? Is that by design or an oversight? I can contribute but need to know.

EDIT: The problem comes down to usage of PEARX\PackageXml\Parser and how it behaves. In order to switch the extension, the PeclExtension is built (PhpBrew\Extension\ExtensionFactory:: createPeclExtension) using PEARX\PackageXml\Parser. It looks like this parser is ready to read from a file instead of downloading extension xml but there is sth fishy with the path.

I'll dig deeper when we have some info from @c9s

hi @mirfilip @0captain I will take a look at this issue when I have time. thanks for reporting this.

Hi, I'm stuck with this problem too when I try to install pear. I'm behind a proxy (it blocks gitter, btw -_-), and all in all, it triggers the same warning for the same reason.
In fetchChannelXml(), I see that the method checks the cache before downloading. Is it possible to push the channel.xml in cache "manually" ?

Same problem here. I am behind a proxy, but I haven't had any problem using phpbrew until now. When trying to install xdebug I get the following error:

PHP Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
PHP Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
PHP Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
PHP Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
PHP Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(http://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
PHP Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35

Warning: file_get_contents(https://pecl.php.net/channel.xml): failed to open stream: Network is unreachable in phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Core.php on line 35
Exception: channel.xml fetch failed.
Thrown from phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Channel.php at line 148:

145 }
146
147 if( ! $xmlstr ) {

148 throw new Exception('channel.xml fetch failed.');
149 }
150
151 // save cache
152 if( $this->cache ) {

Trace:

0) PEARX\Channel->fetchChannelXml('pecl.php.net')
    from phar:///usr/local/bin/phpbrew/vendor/corneltek/pearx/src/PEARX/Channel.php: 64

1) PEARX\Channel->__construct('pecl.php.net')
    from phar:///usr/local/bin/phpbrew/src/PhpBrew/Extension/Provider/PeclProvider.php: 37

2) PhpBrew\Extension\Provider\PeclProvider->getPackageXml('xdebug', 'stable')
    from phar:///usr/local/bin/phpbrew/src/PhpBrew/Extension/Provider/PeclProvider.php: 74

3) PhpBrew\Extension\Provider\PeclProvider->buildPackageDownloadUrl('stable')
    from phar:///usr/local/bin/phpbrew/src/PhpBrew/Extension/ExtensionDownloader.php: 35

4) PhpBrew\Extension\ExtensionDownloader->download(PhpBrew\Extension\Provider\PeclProvider, 'stable')
    from phar:///usr/local/bin/phpbrew/src/PhpBrew/Command/ExtensionCommand/InstallCommand.php: 169

5) PhpBrew\Command\ExtensionCommand\InstallCommand->execute('xdebug')

PHP Notice: Undefined index: file in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 101

Notice: Undefined index: file in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 101
PHP Notice: Undefined index: line in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 101

Notice: Undefined index: line in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/ExceptionPrinter/DevelopmentExceptionPrinter.php on line 101
from : 0

6) call_user_func_array([PhpBrew\Command\ExtensionCommand\InstallCommand, 'execute'], ['xdebug'])
    from phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/CommandBase.php: 845

7) CLIFramework\CommandBase->executeWrapper(['xdebug'])
    from phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/Application.php: 398

8) CLIFramework\Application->run(['/usr/local/bin/phpbrew', '-d', 'ext', 'install', '--http-proxy=myproxy.com:8080', 'xdebug'])
    from phar:///usr/local/bin/phpbrew/src/PhpBrew/Console.php: 119

9) PhpBrew\Console->runWithTry(['/usr/local/bin/phpbrew', '-d', 'ext', 'install', '--http-proxy=myproxy.com:8080', 'xdebug'])
    from phar:///usr/local/bin/phpbrew/scripts/phpbrew-emb.php: 2

10) require('phar:///usr/local/bin/phpbrew/scripts/phpbrew-emb.php')
    from /usr/local/bin/phpbrew: 99

Is there any known issue about this? Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ยท  6Comments

sam452 picture sam452  ยท  3Comments

oNdsen picture oNdsen  ยท  5Comments

WelingtonM picture WelingtonM  ยท  5Comments

rsantellan picture rsantellan  ยท  3Comments