cron job || it works on localhost, not in production
-
Hello,
I’m working on a plugin with use a cron job.
function fftp_activate_cron() { // Schedule an action if it's not already scheduled if ( !wp_next_scheduled( 'scheduled_task' ) ) { wp_schedule_event( time(), 'hourly' , 'scheduled_task'); } }
The task seems to work perfectly on localhost, in view of the classic cron job in wordpress: on page request. But the same plugin doesn’t work at all in production. I have tried on 2 different severs.
How is it possible?
I installed the plugin Advanced Cron Manager to understand:
> on localhost
at the beginnig, i get as ‘next excecution’: At next page refresh
on a page refresh, i get the right information: In 2 minutes> on production
i get: At next page refresh
even after several page refreshCould it be a wrong init of the cron job which could explain the problem on production server?
Could it be a miss configuration (wp-config.php, server, etc)?I am lost.
Any idea will be appreciate.Thank you in advance,
jb
- The topic ‘cron job || it works on localhost, not in production’ is closed to new replies.