简体   繁体   中英

Syntax error near unexpected token `newline' in cPanel

I am trying to back up my database in Laravel using Spatie package. Every thing worked fine till 31 Decemeber 2020 and in New Year my cron job stoped working. I don't know what happened, but on my cPanel mail I am receiving this email:

/usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `newline'
/usr/local/cpanel/bin/jailshell: -c: line 0: `/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> '

and this is the cron job I am applying:

/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> /dev/null 2>&1

possible solutions

  1. check your php version and php multimanager in cpanel both match or not
  2. go to storage/log/laravel log read cron error
  3. in any controller use

use Illuminate\Support\Facades\Artisan; Artisan::call('backup:run'); dd(Artisan::output()); now you can check your command working or not and able to find errors

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM