Laravel 5 deployment to heroku: Error output: PHP Fatal error: Class not found in ProviderRepository.php

Deadly 提交于 2019-12-11 10:00:47

问题


Beware: Beginner here.

I have successfully deployed a barebones copy of a laravel 5 project to heroku.

But when I try to deploy now after having added some files + some composer packages(namely laravel-debugbar), I get this error when I do $ git push heroku master

remote: Error Output: PHP Fatal error: Class 'Barryvdh\debugbar\ServiceProvider'not found in /tmp/build_855da4ace28f1a4e714d4ebf8b1dd1d4/vendor/laravel/framework/src/Illuminate/foundation/ProviderRepository.php on line 150

I am not sure if it helps, but I use Windows 8.1 with Homestead. The code works just fine in development.


回答1:


Heroku does automatically install dependencies by running composer update when you push. However it does that without installing require-dev dependencies. (using the --no-dev flag)

The quickest solution is to just define the dependencies you need on heroku in the require section.

(It might be possible to change that behavior of heroku, but I don't know how)



来源:https://stackoverflow.com/questions/28266778/laravel-5-deployment-to-heroku-error-output-php-fatal-error-class-not-found-i

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