调试 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:10:25  来源:igfitidea点击:

Debugging a Laravel 5 artisan migrate unexpected T_VARIABLE FatalErrorException

debugginglaravellaravel-5.1artisanartisan-migrate

提问by S P

When running artisan migrateon a Laravel 5 project, it is failing with the following FatalErrorException:

artisan migrateLaravel 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 目录中。

http://laravel.com/docs/5.1/errors#logging

http://laravel.com/docs/5.1/errors#logging

回答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”)将为您提供正确的堆栈跟踪。