Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use PEAR behind proxy?

Tags:

php

proxy

pear

Initially I used the following with no success;

export http_proxy=http://username@password:host:port 

Worth noting I don't get a connection error directly, instead;

[root@pal ~]# sudo pear info  PHP_CodeSniffer-1.2.1 No information found for `PHP_CodeSniffer-1.2.1' 
like image 916
Daniel Morris Avatar asked Feb 15 '10 14:02

Daniel Morris


2 Answers

Instead of using the system's http_proxy, set the proxy directly in pear's config;

pear config-set http_proxy http://username:password@yourproxy:80 
like image 146
Daniel Morris Avatar answered Sep 29 '22 08:09

Daniel Morris


You also may have an issue with your sudo user having different configuration from your user for pear.

If you make this :

pear config-set http_proxy http://username:password@yourproxy:80 

Then

sudo pear channel-discover pear.symfony-project.com 

You have change user and the proxy is still not set.

So use the appropriate command:

sudo pear config-set http_proxy http://username:password@yourproxy:80 

(Issue spotted on Ubuntu 11.04 fresh install)

like image 36
Damien Avatar answered Sep 29 '22 08:09

Damien