I’m running 10.1.0 of ownCloud and have tried to setup the cron.php to use Cron. In the General admin section I have selected CRON. Then I put the following command line in the user cron for the account that the ownCloud is installed in. Its a cPanel server.
When left for CRON to run I get cron error internal server error sent to the hosting account email address.
However, If login via SSH and execute php -f /home/example/public_html/cron.php at the command line the command functions without error and the admin area indicates the last time cron ran was the time I manually ran the command via ssh.
I ended up writing a php script with cURL to call it via an HTTP call.
I know I should not have to, but the cron was only throwing error and the HTTP call seems to work just fine.
So ad odd as it seems I call the curl script to call the cron via HTTP.
<?
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "https://example.net/cron.php");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>
It’s just one less account to manage. I still think it strange that the cron.php will run correctly when called from the command line manually but not in the crontab. This is just a work around since the ajax and web cron seem to work fine. The cURL script just makes it work on the server with no other accounts necessary.