开发者

How to setup HTTP proxy settings in PHP?

I am trying to write a program in PHP which I had already written in Java. I had used the follow开发者_如何学编程ing statements to setup proxy in Java

System.setProperty("http.proxyHost",proxyhost);
System.setProperty("http.proxyPort",proxyport);

How do I do the same for PHP?


I think you may need to use the cURL extension to carry out the transfer and pass the relevant proxy options to cURL.

cURL Extension

curl_setopt function to pass options to a cURL session

The proxy options you need are: CURL_PROXY and CURL_PROXYPORT.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜