Filesystem.php - failed to open stream: No such file or directory once moved to production
Hi everyone.
I made multiple web-applications using Laravel and I love it. However - I've bumped into a weird issue today that I can't seem to find the answer for. As with all applications I've done so far - I copy/pasted all the files to the production server, set up the .env file, edited app.php and database.php in the config folder but i keep getting this error:
ErrorException in ClassLoader.php line 412:
include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory
Now... I've tried everything i found on the web so far. Clearing cache, checking file permissions, running composer dump autoload, reuploading all the files - but nothing seems to help. It's a shared hosting with PHP v5.6 which already has several laravel applications running and they work perfectly. The only difference is that this one is laravel 5.3 and the other are 5.2.
Assuming that file got copied over, are you storing anything in local storage? If you are, it may be that filesystems.php referneces the storag_path()...this may need to be looked at.
If i just copy/paste my localhost installation without changing any of the configuration files - i get the login screen but i obviously can't login since the database settings are incorrect. So i swapped the .env file and managed to log in. But the second i revisit the same location twice - i get the same error which then crashes the whole application. here's a full error stack:
ErrorException in ClassLoader.php line 411:
include(/home/xxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory
in ClassLoader.php line 411
at HandleExceptions->handleError('2', 'include(/home/xxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory', '/home/xxxx/public_html/appname/vendor/composer/ClassLoader.php', '411', array('file' => '/home/xxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php')) in ClassLoader.php line 411
at Composer\Autoload\includeFile() in ClassLoader.php line 411
at Composer\Autoload\includeFile('/home/xxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php') in ClassLoader.php line 300
at ClassLoader->loadClass('Illuminate\Filesystem\Filesystem')
at spl_autoload_call('Illuminate\Filesystem\Filesystem') in Application.php line 539
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 253
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
I copied eveything. Like I said - there are several laravel apps already on that same shared hosting working perfectly (v5.2).
I can't do composer install on the server because it's a shared server - not dedicated. But again, all of my other projects work perfectly, and I deployed all of them the same way I did this one.
I'm really clueless about this since it works on my dev machine, and all the files are there.
Sigh... I recopied the exact same files again - and now i'm getting a slightly different error stack (still about filesystem though)
FatalErrorException in Application.php line 539:
Class 'Illuminate\Filesystem\Filesystem' not found
in Application.php line 539
at FatalErrorException->__construct() in HandleExceptions.php line 133
at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap() in Application.php line 203
at Application->bootstrapWith() in Kernel.php line 253
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter() in Kernel.php line 116
at Kernel->handle() in index.php line 54
at {main}() in index.php line 0