JonasLAX Posted March 30, 2009 Share Posted March 30, 2009 Hi everybody, As an entrepreneur who started his own web business a couple of months ago I find myself having to write some basic PHP stuff which is giving me a bit of a tough time as I come from desktop programming. Therefore, I believe that most of my questions will be very easy for you to answer. I've created a script now which I have successfully set up as a scheduled task on my own machine to be executed every couple of hours. However, I would like to execute this script through a proxy server. I know how to browse using a proxy server but I assume that setting up Firefox to use a proxy will not make the automated script execution of php go through the same proxy. Therefore, my question is how do I change the script to connect to an external proxy server and then execute through that. Or do I have to configure my local apache server to connect to some proxy and that is it? Do you know of any good free proxies by any chance? Thank you very much in advance! All the best, Jonas Quote Link to comment https://forums.phpfreaks.com/topic/151764-automatic-script-execution-through-proxy-server/ Share on other sites More sharing options...
JonnoTheDev Posted March 30, 2009 Share Posted March 30, 2009 Does your script use CURL? Quote Link to comment https://forums.phpfreaks.com/topic/151764-automatic-script-execution-through-proxy-server/#findComment-796910 Share on other sites More sharing options...
JonasLAX Posted March 31, 2009 Author Share Posted March 31, 2009 Currently not, just a simple file_get_contents() - should I try and change to CURL? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/151764-automatic-script-execution-through-proxy-server/#findComment-797565 Share on other sites More sharing options...
JonnoTheDev Posted March 31, 2009 Share Posted March 31, 2009 Use CURL as you can set a proxy address i.e. curl_setopt($ch, CURLOPT_PROXY, "ip:portnumber"); // if authenticaton is required curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password"); http://uk.php.net/curl As far as free proxies just search Google, you will find loads. However they are not always reliable and get abused. Better paying for private addresses. Quote Link to comment https://forums.phpfreaks.com/topic/151764-automatic-script-execution-through-proxy-server/#findComment-797608 Share on other sites More sharing options...
JonasLAX Posted April 1, 2009 Author Share Posted April 1, 2009 Thanks - worked like a charm Quote Link to comment https://forums.phpfreaks.com/topic/151764-automatic-script-execution-through-proxy-server/#findComment-798859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.