1

Currently I am working on a laravel project that uses some cron jobs to process data.

The default php version on this server is 7.0.7. However this project runs on php 5.6.6 through phpbrew.

When I execute a script inside my project folder through laravel artisan, phpinfo() returns php version 5.6.6. When my cron job executes the exact same command it returns version 7.0.7.

Is it possible to say to my cron to use a different php version through phpbrew? How would it look like?

My cron job looks like:

00 12 * * * php /projectfolder/artisan execute:command

Thomas Van der Veen
  • 3,136
  • 2
  • 21
  • 36

1 Answers1

1

You will need to change your cron to link the absolute path of the php binary you want to use. 00 12 * * * /path/to/bin/that/is/used/by/app/php /projectfolder/artisan execute:command

Also, if this is L5.1 or greater, check out task scheduling https://laravel.com/docs/master/scheduling

Moak
  • 12,596
  • 27
  • 111
  • 166