Skip to content

Different path to PHP not respected in crontab > scheduled tasks. #2196

@bazizsafi

Description

@bazizsafi

Hi,

on our web hoster we need to use a different path to PHP to select the correct PHP version. Instead of /usr/bin/php we need to use /usr/bin/php8.0.
No big deal, this is covered in the installation guide at https://github.com/freescout-helpdesk/freescout/wiki/Installation-Guide#9-configuring-cron-jobs.

However, setting this path to PHP in the crontab does not change the path to PHP of the scheduled tasks:

This is the crontab with the desired path to PHP:

* * * * * /usr/bin/php8.0 /path/to/freescout/installation/artisan schedule:run >> /dev/null 2>&1

When I run this command manually, it reveals that the scheduled tasks use the default path to PHP '/usr/bin/php':

$ /usr/bin/php8.0 /path/to/freescout/installation/artisan schedule:run
Running scheduled command: '/usr/bin/php' 'artisan' freescout:fetch-monitor > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php' 'artisan' freescout:check-conv-viewers > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php' 'artisan' freescout:fetch-emails > '/path/to/freescout/installation/storage/logs/fetch-emails.log' 2>&1
Running scheduled command: '/usr/bin/php' 'artisan' queue:work --queue='emails,default,1e0dfc970c9f3c1aca93f5554779bc52' --sleep=5 --tries=1 > '/path/to/freescout/installation/storage/logs/queue-jobs.log' 2>&1
Content-type: text/html; charset=UTF-8

$

How do I make the scheduled tasks also use our desired path to PHP?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions