How to configure HTTP proxy settings in PHP?

I am trying to write a program in PHP that I already wrote in Java. I used the following instructions to configure a proxy server in Java

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

How do I do the same for PHP?

0
source share
1 answer

I think you may need to use the cURL extension to complete the transfer and pass the corresponding proxy settings to cURL.

cURL extension

curl_setopt function for passing parameters to a cURL session

The required proxy server settings are: CURL_PROXY and CURL_PROXYPORT.

+4
source

All Articles