Laravel 4 Class not found in bootstrap/compiled.php

composer-php, laravel-4

Solution

php artisan optimize --force

That command will re-generate `/bootstrap/compiled.php`

The `--force` arg is needed to re-generate the file when your environment is in debug mode.

Problem

I have created a new branch using Git, applied some updates to my code, checked out that branch on my staging server and I now can't run anything composer related. I've added some new packages to composer.json which work on my development environment, but as soon as I try `composer update` on the staging environment I get class not found errors relating to the classes it's not yet downloaded. I've tried ``` composer update composer dump-autoload php artisan clear-compiled php artisan dump-autoload php artisan optimize ``` But all result in the following error ``` PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider' not found in /var/www/sites/x/bootstrap/compiled.php on line 4321 Script php artisan clear-compiled handling the pre-update-cmd event returned with an error [RuntimeException] Error Output: PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider' not found in /var/www/sites/x/bootstrap/compiled.php on line 4321 ``` What else can I try in order to get composer to download new files?

Original source