如何在代理后面使用PEAR?

时间:2022-06-29 07:17:40

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'

4 个解决方案

#1


83  

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

而不是使用系统的http_proxy,直接在pear的配置中设置代理;

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

#2


13  

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

您的sudo用户也可能遇到与您的用户不同的配置问题。

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)

(在Ubuntu 11.04全新安装上发现问题)

#3


4  

Note that "pear config-set http_proxy" works whereby "pecl config-set http_proxy" does not, even though "pecl config-get http_proxy" does.

请注意,“pear config-set http_proxy”的工作原理是“pecl config-set http_proxy”不会,即使“pecl config-get http_proxy”也可以。

That one cost me me quite a bit of hair pulling :-)

那个花了我很多头发拉动:-)

#4


2  

This will remove proxy settings:

这将删除代理设置:

pear config-set http_proxy ""

#1


83  

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

而不是使用系统的http_proxy,直接在pear的配置中设置代理;

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

#2


13  

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

您的sudo用户也可能遇到与您的用户不同的配置问题。

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)

(在Ubuntu 11.04全新安装上发现问题)

#3


4  

Note that "pear config-set http_proxy" works whereby "pecl config-set http_proxy" does not, even though "pecl config-get http_proxy" does.

请注意,“pear config-set http_proxy”的工作原理是“pecl config-set http_proxy”不会,即使“pecl config-get http_proxy”也可以。

That one cost me me quite a bit of hair pulling :-)

那个花了我很多头发拉动:-)

#4


2  

This will remove proxy settings:

这将删除代理设置:

pear config-set http_proxy ""