The php in your command line path is not the right version
You need to change the path or (preferably) put the full path in the cron job
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have hosted by project on shared hosting where my 'app' folder i outside public_html The php version is 7.3.5, the issue i am having is.. i am have created a cron job to automatically backup the project database but i keep getting this error on my logs;
[08-Jun-2019 21:04:01 UTC] PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/username/app-folder/vendor/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php on line 83
I am using spatie/laravel-backup.
My cron is set as
* * * * * php /home/username/app-folder/artisan backup:run
The php in your command line path is not the right version
You need to change the path or (preferably) put the full path in the cron job
Please or to participate in this conversation.