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

tibormarias's avatar

Laravel Schedule run command on a server

My website is hosted on a Plesk Onyx web server. On my development local server, I can schedule a command, and it runs perfectly every minute but when it's on my production web server, it does not work. (there is a schedule set up to run php artisan schedule:run every minute in Plesk) Probably, Laravel runs the command as following: php artisan send:email, but Plesk does not understand the command "php"... Because it uses /opt/php/7.2 or similar for that. Am I right?

If so, please help me how could I solve this issue..

Thanks in advance!

0 likes
6 replies
Krisell's avatar

If the problem is that php is not recognized as a command, you could create an alias for php on the server, or creating a symlink named php and put it in one of the $PATH-folders.

1 like
tibormarias's avatar

Before I dived more into this command stuff, I changed the code from command to a call function, and the email is still sent from the local server, but not from development... :( So the problem was not with the server not recognizing php as a command. Any other idea? Can I somehow see error log for this schedule?

Thanks in advance

Krisell's avatar

Can you run the emailing command manually on the server (not the scheduling)? You'll see the output and if there are any errors when you do. Did you configure email for the server?

1 like
tibormarias's avatar

I think the problem is that my server does not run the main schedule:run command...

This is my schedule command: cd /my-site-directory /opt/plesk/php/7.2/bin/php artisan schedule:run

Although it does not give me error, I don't know if it runs correctly or not..

Krisell's avatar

If there is no output, it probably worked. Do you have a command scheduled for ->everyMinute(), or what do you expect to run?

Also, make sure to test each individual command manually (or preferably with automated tests) before running them through the scheduler.

1 like
tibormarias's avatar
tibormarias
OP
Best Answer
Level 2

I have finally managed to solve it.. System root SSH access was forbidden in Plesk... Thanks for you time Krisell!

Please or to participate in this conversation.