调试 Laravel 5 工匠迁移意外 T_VARIABLE FatalErrorException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31983907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debugging a Laravel 5 artisan migrate unexpected T_VARIABLE FatalErrorException
提问by S P
When running artisan migrate
on a Laravel 5 project, it is failing with the following FatalErrorException
:
在artisan migrate
Laravel 5 项目上运行时,它失败并显示以下内容FatalErrorException
:
$ artisan migrate -vvv --force
[Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected '$table' (T_VARIABLE)
$ 工匠迁移 -vvv --force
[Symfony\Component\Debug\Exception\FatalErrorException] 语法错误,意外的 '$table' (T_VARIABLE)
How do I get the file and line that is causing the error?
如何获取导致错误的文件和行?
If in anyway relevant, I'm on a Windows 7 x64 machine with WAMP - PHP 5.6 and Laravel Framework version 5.1.10 (LTS).
如果有任何相关,我在 Windows 7 x64 机器上使用 WAMP - PHP 5.6 和 Laravel Framework 版本 5.1.10 (LTS)。
回答by ARIF MAHMUD RANA
There might be a semicolon or bracket missing a line
可能有一个分号或括号缺少一行
Check all in your migration files.
Check all in your migration files.
Laravel is configured to create daily log files for your applicationwhich are stored in the storage/logs directory.
Laravel 配置为为您的应用程序创建每日日志文件,这些文件存储在 storage/logs 目录中。
回答by fico7489
This class Symfony\Component\Debug\Exception\FatalErrorExceptionhas some differences compared with the other Exception classes and it is not properly presented by the "error renderers" or "error notifiers".
这个类Symfony\Component\Debug\Exception\FatalErrorException与其他 Exception 类相比有一些差异,它没有被“错误渲染器”或“错误通知器”正确呈现。
A New sentry"error notifier" ("getsentry/sentry-php"version >= "2.0") will give you a proper stack trace.
新的哨兵“错误通知程序”(“getsentry/sentry-php”版本>=“2.0”)将为您提供正确的堆栈跟踪。
- Here is issue where is reported : https://github.com/getsentry/sentry-php/issues/761
- Here is the PR for fix : https://github.com/getsentry/sentry-php/pull/763