OSTicket PHP version error when running crontab -e

Hello from Oklahoma!

I’m having an issue with OsTicket on my YunoHost where the Cron task gives an error about PHP version.

My YunoHost server

Hardware: VPS bought online from IONOS
YunoHost version: 11.2.10.1
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

I’m trying to use crontab -e to trigger a cron job that will fetch emails for new tickets in the OsTicket system. When I set this up, I made sure to have cron email my YunoHost email so I can see the errors. This helped me work through a few issues with getting the cron file to look correct and actually try to run the command I ended up with this:

*/2 * * * * /usr/bin/php /var/www/osticket/api/cron.php

Once I got rid of the errors about the command structure and the user I had set it up under, I got this error, which I’m unsure what to do next.

yunohost cron job PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33. in /var/www/osticket/include/laminas-mail/vendor/composer/platform_check.php on line 24 Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.33. in /var/www/osticket/include/laminas-mail/vendor/composer/platform_check.php on line 24

Any help would be appreciated.

YunoHost uses Sury.org to install multiple versions of PHP side-by-side, you need to explicitly specify which version to use. The cron entry should look something like

*/2 * * * * /usr/bin/php8.2 /var/www/osticket/api/cron.php

as OsTicket_ynh uses PHP 8.2

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.