cPanel中意外令牌'newline'附近的语法错误 [英] Syntax error near unexpected token `newline' in cPanel

查看:91
本文介绍了cPanel中意外令牌'newline'附近的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Spatie软件包在Laravel中备份我的数据库.一切顺利,直到2020年12月31日为止,在新年,我的Cron工作停止了工作.我不知道发生了什么,但是在我的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>> '

这是我正在申请的Cron工作:

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. 在cpanel中检查您的php版本和php multimanager是否匹配
  2. 转到storage/log/laravel日志读取cron错误
  3. 在任何控制器中使用

使用Illuminate \ Support \ Facades \ Artisan;Artisan :: call('backup:run');dd(Artisan :: output()); 现在您可以检查命令是否正常运行并能够找到错误

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

这篇关于cPanel中意外令牌'newline'附近的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆