Syntax error near unexpected token `newline' in cPanel

孤人 提交于 2021-01-29 20:08:07

问题


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

回答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



来源:https://stackoverflow.com/questions/65872966/syntax-error-near-unexpected-token-newline-in-cpanel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!