Cronjob is not running 😏

I made a cron script located at /public_html/cron/script.php with this code:


  foreach(get_sites_list() as $item){
  //Log to a txt file to make sure the script is executed
  $log_message = 'Run at ' . date('Y-m-d H:i:s') . "\n";
  $file = fopen('log.txt', 'a+');
  fwrite($file, $log_message);



It basically loops through the database and updates it.

Unfortunately, the script hasn’t been executed even once :smirk: I don’t know what’s wrong with it. I made sure it works properly by going to and saw the database and log file successfully updated.

Why 000webhost won’t execute it then?

P.S: functions.php is located under /public_html/includes/

@ckhawand More than 10 minutes have passed and still the cronjob hasn’t run :confused:

Can you screenshot your cron jobs area in your cPanel?

Here you go! I set it to execute every 10 minutes.

Can you send me your account credentials so I can check that issue?
(I have set this topic to private)

okay ~
email: *************
password: ***********

I’ll check that now :slight_smile:

I have modified some things, let’s wait 10 minutes and see what happens :slight_smile:

1 Like

Then, we’ll try something else,

  1. Take a backup of your website and database.
  2. Delete your website.
  3. Create a new one.
  4. Re-upload the files and the database.
  5. Creat a new cron-job :slight_smile: