Composer安装laravel-cors时出错 [英] Composer error installing laravel-cors

查看:208
本文介绍了Composer安装laravel-cors时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装laravel-cors

I tried to install laravel-cors

composer require barryvdh/laravel-cors

安装成功,或者我以为如此,但是当我去发布配置时,出现此错误:

It installed successfully or so I thought, but then when I went to publish the config I get this error:

[RuntimeException]
错误输出:PHP致命错误:无法在第413行的/www/config/vendor/composer/ClassLoader.php:410中重新声明Composer \ Autoload \ includeFile()(先前在/www/vendor/composer/ClassLoader.php:410中声明). /p>

[RuntimeException]
Error Output: PHP Fatal error: Cannot redeclare Composer\Autoload\includeFile() (previously declared in /www/vendor/composer/ClassLoader.php:410) in /www/config/vendor/composer/ClassLoader.php on line 413

我尝试删除laravel-cors,但仍然收到此错误.我也抛弃了自动加载功能.我想念什么?

I have tried removing laravel-cors and I still get this error. I have dumped autoload as well. What am I missing?

幼虫5.2 | PHP 5.6.17

Larval 5.2 | PHP 5.6.17

推荐答案

我知道了.当我输入

composer require barryvdh/laravel-cors

我在一个子目录中.因此,作曲家然后将其及其依赖项安装在子目录中,这就是为什么我收到该错误的原因.如果仔细看,您会发现它正在安装在config中

i was in a sub directory. so composer then installed it and the dependencies in a sub directory which is why i was getting that error. If you look closely you can see that it was installing in config

/www/config/vendor/composer/ClassLoader.php:413 
/www/vendor/composer/ClassLoader.php:410

只需要更加注意细节即可.

Just needed to pay better attention to detail.

这篇关于Composer安装laravel-cors时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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