Php Laravel Tinker错误:Symfony\Component\Debug\Exception\FatalThrowableError:调用未定义的方法Psy\Configuration::getLoop()
我试图在我的项目上运行Php Laravel Tinker错误:Symfony\Component\Debug\Exception\FatalThrowableError:调用未定义的方法Psy\Configuration::getLoop(),php,laravel,symfony,tinker,Php,Laravel,Symfony,Tinker,我试图在我的项目上运行php artisan tinker,并出现以下错误: Symfony\Component\Debug\Exception\fatalthrowable错误:调用未定义的方法Psy\Configuration::getLoop() 在/var/www/[my_project]/vendor/psy/psysh/src/psy/Shell.php:80 76 |公共函数uu构造(配置$config=null) 77| { 78 |$this->config=$conf
php artisan tinker
,并出现以下错误:
Symfony\Component\Debug\Exception\fatalthrowable错误:调用未定义的方法Psy\Configuration::getLoop()
在/var/www/[my_project]/vendor/psy/psysh/src/psy/Shell.php:80
76 |公共函数uu构造(配置$config=null)
77| {
78 |$this->config=$config?:新配置();
79 |$this->cleaner=$this->config->getCodeCleaner();
>80 |$this->loop=$this->config->getLoop();
81 |$this->context=newcontext();
82 |$this->includes=array();
83 |$this->readline=$this->config->getReadline();
84 |$this->inputBuffer=array();
如您所见,问题出现在第80行。
我想我必须提到,我曾经在我的一个控制器中使用了Throwable
和fatalthrowable error
来获取异常
,因为常规异常
无法获取我所获取的异常!我以另一种方式处理了该Throwable错误,并且能够获取该异常
通过Exception
本身!无论如何,我在代码中的任何地方都没有使用过Throwable
或FatalThrowableError
,但我仍然会遇到前面提到的错误
如何使php artisan tinker
再次工作?我认为问题与composer
有关。我只是手动删除了我的供应商
文件夹,并尝试运行composer安装
。通过这样做,php artisan tinker
命令再次正常工作。
这可能不是正确的解决方案,但无论如何,它再次起作用。可能只是删除vendor/psy
文件夹并运行composer install
也会起到同样的作用