php 如何在代理后面使用 PEAR?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2266491/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use PEAR behind proxy?
提问by Daniel Morris
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'
回答by Daniel Morris
Instead of using the system's http_proxy, set the proxy directly in pear's config;
不用系统的http_proxy,直接在pear的config里设置proxy;
pear config-set http_proxy http://username:password@yourproxy:80
回答by Damien
You also may have an issue with your sudo user having different configuration from your user for pear.
您的 sudo 用户与您的 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)
(在 Ubuntu 11.04 全新安装上发现的问题)
回答by boran
Note that pear config-set http_proxyworks whereby pecl config-set http_proxydoes not, even though pecl config-get http_proxydoes.
请注意,即使确实如此,也不会pear config-set http_proxy起作用。pecl config-set http_proxypecl config-get http_proxy
That one cost me me quite a bit of hair pulling :-)
那个让我花了很多时间拉头发:-)
回答by czezz
This will remove proxy settings:
这将删除代理设置:
pear config-set http_proxy ""

