Welcome Guest, Not a member yet? Register   Sign In
Cron Job - cURL & Private Proxies Problem
#1

[eluser]Unknown[/eluser]
hi...

I'm new to codeigniter so please forgive me if I'm missing something obvious.

I have set up my system to run a cron job as detailed by the example 1 on the cron job tutorial. http://codeigniter.com/wiki/Category:Adv...ronScript/

This cron job is querying an API using cURL.

The code is identical to something I'm running on another server written in PHP only difference is that the other code is NOT using the codeigniter framework.

The problem is that in codeigniter the private proxy feature of my cURL request is not working. Its exactly the same code !!

The code in codeigniter works correctly if I comment out the 3 lines that relate to the private proxy.

My question is this something to do with running this code inside codeigniter, is it something to do with running it as a cron job or something else entirely....

any help would be greatly appreciate...the relevant code is below..

Code:
//add proxy support..  
$randomProxy = rand(0, $maxProxyArray);
$useThisProxy = $proxies[$randomProxy]['proxyUrl'].':'.$proxies[$randomProxy]['proxyPort'];
$useThisProxySettings = $proxies[$randomProxy]['proxyUsername'].':'.$proxies[$randomProxy]['proxyPassword'];
  
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $useThisProxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $useThisProxySettings);






Theme © iAndrew 2016 - Forum software by © MyBB