我想为PHP-curl exection设置代理。它在我使用curl_setopt($ch, CURLOPT_PROXY, $my_proxy);
时工作但是,我们如何使用服务器/ apache设置来设置它?
操作系统:Redhad Enterprise Linux
网络服务器:阿帕奇
尝试以下方法:
export http_proxy="http://my_proxy_address.com:8081/" export https_proxy="https://my_proxy_address.com:8081/"
httpd.conf
文件中的代码:ProxyRequests On
ProxyVia On <Proxy *> Order allow,deny Allow from all </Proxy>
3.提供:~/.bashrc
export http_proxy="http://my_proxy_address.com:8081/"
export https_proxy="https://my_proxy_address.com:8081/"
在虚拟主机下的httpd.conf
中提供:
ProxyRequests On
ProxyRemote * http://my_proxy_address.com:8081