问题
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