Laravel 4 class not found after doployment to production - laravel

Error:
Class 'App\Package\PackageServiceProvider' not found
After moving my laravel directories to my server. The app is under psr-0.
The same files are found and working locally without any errors.
I tried to update composer with and without dump but nothing changes.
Why does that happen?

By default, the vendor directory is not checked into your git repository. So, just run composer install on your server and it should take care of the rest.

Related

Composer - RuntimeException in RootPackageLoader after laminas-migration

I have a strange issue with composer. Having installed as per website docs, and has been working perfectly for days. Updating a zf2 project to laminas. All seemed to be ok after a successful use of laminas-migrate. Updated the new laminas dependencies and was asked to inject Laminas\ComposerAutoloading into my modules.config.php - all ok. After that, i've been getting the following message when i run composer update:
RootPackageLoader.php line 162:
[RuntimeException]
require.laminas/laminas-di is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "^a-z0-9/a-z0-9$".
This even happens if i am in my project dir and run composer -V.
Strangely, if i cd / then run composer -V, i get the correct output (composer version without the RootPackageLoader exception).
I have deleted composer from /usr/local/bin and reinstalled, issue persists.
After a few evenings of going round in circles, i ended up deleting the whole project and starting afresh. This time, there were none of the above issues with laminas-migrate. The only thing i did differently was to run laminas-migrate on the project straight out of the repo, instead of trying to update all the packages to as-close-to-zf3 before migrating to laminas. Seemed to work fine.

Running composer install doesn't resolve undefined type error in cloned Laravel project

I've cloned a Laravel project from Github, then I've run composer install for getting vendor folder. This folder has appeared but I also get weird red lines under each class that show Undefined Type errors. I also deleted the composer.lock and run composer update, but the errors are still there!
Is there any other thing that I should do?
The project was running perfectly, So I found out it was because of my IDE.
The VS Code wanted to validate code using php, and it is not finding php installed.
It's solved by setting php.validate.executablePath in Vs Code setting.
For more information: "Cannot validate the php file. The php program was not found"

Does Laravel autogenerates autoload files without runninq composer by user?

A strange thing happened on my server:
autoload files in vendor/composer directory were touched/regenerated without me or any other user running composer install, composer update, composer dump-autoload or any other commands. My main concern is that one of the files was generated with invalid data that crashed my whole site and it took a time to find the problem.
Are there any circumstances that Laravel does this automatically? (There may have been a network malfunction for a few minutes when this happened.) If yes, where can I read about this in the documentation? Is it possible to turn it off?

Laravel Error "Unable to load the "app" configuration file" after Windows file restore

Bad mistake this morning. I uninstalled WAMP Server which deleted the Wamp folder and all its projects.
I restored the wamp folder from backup. WAMP is up and running on upgraded PHP and settings as before, however:
Laravel projects won't start - getting blank whoops pages on any Laravel project. When I cd into any project folder and try to run php artisan, I get:
Unable to load the "app" configuration file.
The 'config/app.php' does indeed exist. And, all the restored files appear correct.
As a test, I installed a new Laravel project and it works correctly. I also am able to clone a project from a Git repo, npm update & composer install, and that works. So, I don't think the problem is with the WAMP stack.
I need some direction troubleshooting this. Thanks!
The problem is that Windows changes the case of some file names during restore. What a drag. There seems to be no reasonable answer except make the switch to Apple.
For example, in the Laravel config folder, Windows restored these files with proper case, App.php, Auth.php, Queue.php, and View.php. Everything else was left lowercase as they need to be.
Correcting the case of these files fixed the problem for now (until I find other mis-cased files).
Make sure this file exist
config/app.php

Composer create the project at an unknown location

I tried to execute
composer create-project laravel/laravel
It is saying that it is creating the project at "C:\Users\FXFX\" but there is no visible project at "C:\Users\FXFX\", I wonder where is my projects gone?
This happens because of the "Comodo Internet security sandbox". It always sand box the composer and that resulted to creating it's files inside the sandbox in my case "C:\VTRoot\HarddiskVolume3\Users\FXFX".
Solution :
I exclude composer directory from the sandbox.

Resources