CURLOPT_NOPROXY does not affect in PHP

后端 未结 3 1797
挽巷
挽巷 2021-01-18 20:00

I have http_proxy settings in my /etc/environment on my Ubuntu machine. I have defined CURLOPT_NOPROXY as 10177 and then do

$curl = curl_init(\'http://127.0         


        
相关标签:
3条回答
  • 2021-01-18 20:33

    I also had a problem with curl using a proxy only in PHP curl calls. I eventually found that SUSE specifically SLES 11 had some proxy values set. Changing those proxy values fixed issues in linux but I had to restart the entire server not just apache for the changes to take affect in PHP. I used YAST to change the proxy values on the server.

    0 讨论(0)
  • 2021-01-18 20:46

    It happened with me so i set the proxy to empty string and it worked

    curl_setopt($ch, CURLOPT_PROXY, '');
    
    0 讨论(0)
  • 2021-01-18 20:49

    According to PHP's Manual, you should set CURLOPT_HTTPPROXYTUNNEL to false:

    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
    
    0 讨论(0)
提交回复
热议问题