Composer error installing laravel-cors

筅森魡賤 提交于 2019-12-25 07:58:32

问题


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]
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

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

Larval 5.2 | PHP 5.6.17


回答1:


I figured it out. When i typed

composer require barryvdh/laravel-cors

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.



来源:https://stackoverflow.com/questions/36064067/composer-error-installing-laravel-cors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!