The MU forums have moved to WordPress.org

Cron for WPMU (3 posts)

  1. shyuan
    Member
    Posted 14 years ago #

    Hi,

    If my web host company doesn't allow Cron Job and Curl for the hosting plan I took, will the crons in WPMU still run automatically?

    I was wondering because I supposed we do not need to use a Cron Job to run, let say, cron.php, but just not too sure if it will still work when the Cron Job in cPanel is disabled.

    Thanks!

  2. SteveAtty
    Member
    Posted 14 years ago #

    WP cron is trigged by visits to the WP front end. If no-one visits your blog then the cron tasks will never run. Its totally independent of the o/s cron systems

  3. dreamdevil
    Member
    Posted 14 years ago #

    SteveAtty is right. Scheduled tasks are triggered by web requests. But you are right to wonder if its going to work since your hosting plan won't allow CURL. Normally Wordpress may use CURL to submit an asynchronous call to wp-cron.php to run the jobs.

    While searching for actually replacing this process by a real cron job (See: Run Wordpress tasks from real cron job) I got my hands on WP_Http. This class is responsible of making that CURL call. What's nice (for your situation) is it first try with http extension, if it fails, then try with CURL, if it still fails, it will try another method (like fopen), etc. So it is likely to find one that works with your hosting.

    However, if none of them work, you still can rely on another available implementation: a redirect. It's not ideal and not wanted for blogs with some traffic but should work. You can enable this by setting this constant in your wp-config.php:
    define('ALTERNATE_WP_CRON', true);

    Pascal.

About this Topic

  • Started 14 years ago by shyuan
  • Latest reply from dreamdevil