Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

techyad's avatar

Schedule command not work

Hello everyone, I have set a cronjob to run everyminute in the cpanel and also write a task to run every minute in the Console/Kernel.php as well.

        $schedule->call(function(){
            logger()->error('hello2');
        })->everyMinute();

We have two hosts on a same server the code works correctly in the host1 but does not work in the host2.

the cron job is :

/usr/local/bin/ea-php74 /home/username/backend/artisan schedule:run >> /home/username/cronlog.txt

the log contains only "there are no scheduled command ready to run"

how can i fix this? I am usign laravel 8.* with php 7.4

"Note: I copied all the files and database from host1 on the new host but i try to change the apllication key too but all these did not help me"

0 likes
13 replies
MohamedTammam's avatar

On your server make the corn job command runs every second. On your Laravel app make it runs every minute.

MohamedTammam's avatar

@Sinnbeck Yeah, I just checked the docs :). I thought the problem might be that. Now it might be something else :)

techyad's avatar

@MohamedTammam this is my cron job command :

*	*	*	*	*	/usr/local/bin/ea-php74 /home/username/backend/artisan schedule:run >> /home/username/cronlog.txt
MohamedTammam's avatar

@techyad Just to be more clear, what do you mean be running two hosts in the same server? do you mean two websites?

Sinnbeck's avatar

Run the schedule command manually to check. What does it say?

techyad's avatar

@Sinnbeck

No scheduled commands are ready to run.

There is no log and error and very strange to me , also i removed all task and keep just that but did not work

Sinnbeck's avatar

@techyad seems your kernel isn't updated?

cat app/Console/Kernel.php

Is the change there? Did you not get it uploaded?

techyad's avatar

@Sinnbeck

We don't have such path in the larvel. I put my tasks in app/Console/Kernel.php

techyad's avatar

@Sinnbeck

Yes as i mentioned i put the task in that file. I just created a fresh laravel app and find out the test code works . it is really strange to me :)).

Sinnbeck's avatar

@techyad and if you ran that command in the none working project, you can see it?

techyad's avatar

@Sinnbeck

I fix the problem with uploading again the source code to new host i think there is something wrong with copying files from the old host although there were not any error log.

Thank you for answering.

Please or to participate in this conversation.