CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Joomla Cron From Php File (Without Command Line Access)
Pages: [1]

Author Topic: Joomla Cron From Php File (Without Command Line Access)  (Read 1178 times)

philraymond

  • I post occasionally
  • **
  • Posts: 40
  • Karma: 2
Joomla Cron From Php File (Without Command Line Access)
September 30, 2009, 12:51:51 pm
Thought this might help someone. I don't have command line access with my host, so I needed a different way to run the cron. Finally settled on putting together this script in a php file and running it from the cron in my control panel. The opening line I used is specific to my server, but yours will be something similar:

Quote
#!/usr/local/bin/php.cli
<?php

// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://<site-and-civicrm-path>/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>");

curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources

curl_close($ch);
?>

Hope this helps someone.

Phil


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Joomla Cron From Php File (Without Command Line Access)

This forum was archived on 2017-11-26.