Laravel 5.4 Artisan Migrate失败,调用未定义的方法dispatch()

问题描述 投票:6回答:4

我有一个Laravel 5.4应用程序在本地工作正常。在尝试将其放在我的生产服务器上时,我无法运行迁移。以下是错误的一部分:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Events\Dispatcher::dispatch() in /path/to/app/vendor/laravel/framework/src/Illuminate/Console/Application.php:56

任何帮助是极大的赞赏。

编辑我只是试图运行php artisan --help,我得到相同的错误。

php laravel-5 artisan
4个回答
6
投票

/bootstrap/cache/删除所有文件并运行这些命令

php artisan cache:clear
php artisan view:clear

它应该解决你的问题


2
投票

我认为你的作曲家没有更新。尝试卸载composer,然后重新安装它。或者尝试更新composer.phar。您正在使用的laravel之间可能存在版本问题。


0
投票

运行“作曲家更新”为我解决了这个问题。


0
投票

我有同样的问题并通过以下方式解决:

  1. 连接到我的生产服务器。
  2. cd bootstrap / cache并通过运行compiled.php命令删除rm compiled.phpfile。
© www.soinside.com 2019 - 2024. All rights reserved.