How to Use Another IP for cURL Requests

By | June 10, 2008

Recently I have had the problem with e-gold automation. E-gold server refused to accept my IP for an unknown reason. I had to send some payments so I triple checked the code, tried different solutions before I got the Idea to try this code from another server IP. This worked and I was happy that my server came with several IPs. All I had to do was to add a string to my code. Here it is:

curl_setopt ($ch,CURLOPT_INTERFACE, “SECOND_SERVER_IP”);

This told cURL to make requests from another IP that was not banned. Hope you will find it useful as it is usually a problem to use different ips for different requests