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

blazen's avatar

Make php artisan schedule:run to call php (instead of php7.0)

Hi,

I run laravel on a managed VPS. Laravel artisan schedule:run calls php7.0 which is not present. This VPS has php70 or php. Is there a way how to instruct Laravel to call php or php70 instead?

Below the console output.

Thank you

David

Running scheduled command: '/usr/bin/php7.0'

:/data/admin4$ php artisan schedule:run

Running scheduled command: '/usr/bin/php7.0' 'artisan' db:create-summary-table > '/dev/null' 2>&1

:/data/admin4$ ls /usr/bin

awk chpst du groups mkdir patch php56 rgrep rsync ucspicat wget basename clear_console echo id mv php php70 rm scp unixclient-thin xz chdirto daemon execute ls mysqldump php54 pwd rmdir tail unxz xzcat chmod diff find mawk mysqlimport php55 realpath rssh touch unzip zip

0 likes
5 replies
tykus's avatar

Execute the artisan command by giving the full path to a valid PHP binary, e.g.

/usr/bin/php/7.0/php artisan schedule:run

Obviously, swap out this path for the appropriate one on your server.

lostdreamer_nl's avatar

don't know where it's getting the setting for the location of PHP, but you could simply create a symlink...

sudo ln -s /usr/bin/php7.0 /usr/bin/php70

after that you should simply be able to use /usr/bin/php7.0 as well.

blazen's avatar

They unfortunately don´t allow me to create a symlink.

I tried the tykus suggestion but it still insists on php7.0 :(

:/data/admin4$ /usr/bin/php70 artisan schedule:run

Running scheduled command: '/usr/bin/php7.0' 'artisan' db:create-summary-table > '/dev/null' 2>&1

Borisu's avatar
Borisu
Best Answer
Level 37

I believe the correct-way to do it is:

update-alternatives --set php /usr/bin/php70

After that php will evaluate to /usr/bin/php70 And check your commands. Maybe the php7.0 is hard coded in the scheduler ;) (You'll probably find it in the AppServiceProvider or a ScheduleServiceProvider)

blazen's avatar

Yes. That is a good solution. Thank you.

Please or to participate in this conversation.