I got this error in error_log after create cron job on cpanel.
PHP Parse error: syntax error, unexpected T_CLASS, expecting T_STRING
or T_VARIABLE or ‘$’ in /home/kardenoc/Smartflyer/artisan on line 33
this is the line mentioned:
$kernel = $app->make(IlluminateContractsConsoleKernel::class);
I’m using php 7.2(choose php 7.2 on cpanel) and laravel 6.
whole process is working expect this cron job.
2
Answers
Your Cpanel version could be different from laravel version please check composer.json for this line
I think the
php
command in the cPanel is using an older version.The quick solution for you is to use the
php7.2
command. E.g. put this in the cron job: