Reputation: 12549
I ran composer install --no-dev
before having to manually deploy to a client's server by FTP that lacks SSH access. When I did so, I received the following error:
PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Way\\Generators\\GeneratorsServiceProvider' not found","file":"C:\\Ampps\\www\\test.dev\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRe
pository.php","line":158}}Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
Each of the app.php
files has the line 'Way\Generators\GeneratorsServiceProvider'
.
This was working fine before running that composer command. Why did this happen and how can it be fixed?
Laravel 4.1.
Upvotes: 1
Views: 3285
Reputation: 5240
In your composer.json
file, you have way/generators
as a development machine dependency only. If you have the service provider 'Way\Generators\GeneratorsServiceProvider'
in each of the app.php
file, then it would mean that way/generators
is a development machine as well as the deployment machine dependency. By doing composer install --no-dev
, you're saying that the packages that are development machine dependency only, shouldn't go in the vendor
directory, which means that the package way/generators
is not installed in the vendor
directory. That's why you're getting the error.
Since way/generators
is a development dependency only, you should remove 'Way\Generators\GeneratorsServiceProvider'
from app/config.php
, so that the deployment machine wouldn't look for it.
Also if you're working on the development machine and performed composer install --no-dev
, the way/generators
package wouldn't be installed in the vendor
directory and you'd get the above error. So you'd have to make the development machine environment as not local
to test whether or not it'd work in the deployment machine.
Upvotes: 3