I am attempting to create a cron job that downloads image files that are stored in a queue in our database. 

All of the functions that we are using work properly when run on our web server, however when I run the cron job using the following command: `php index.php cron image_download` I receive a `Segmentation Fault` error.

Debugging the cron job shows that this error occurs when the data is passed to the get\_url\_content function, which is called here:

```
foreach($urls as $url){

    $content = $this->get_url_content($url); 
}

```

And the function is here:

```
function get_url_content($url){
    $agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_URL,$url);
    return curl_exec($ch);
}

```

Is there a better way to download these files? Is it likely that a different method would not cause the same segmentation fault error? Thank you!

UPDATE: It appears that various methods I am trying are continually causing issues. I am seeing either "Segmentation Fault" or "Killed" errors returned from the cron job. Someone recommended that I look into using [Iron.io](http://iron.io) for this so I am going to check that out. If anyone has other recommendations for how to manage this best I would appreciate additional information, thanks.