Running any PHP Artisan/Composer commands return an error

286 Views Asked by At

I'm trying to Deploy my Laravel application to a staging server when I encountered this error

[ErrorException] require(/var/www/html/<app name>/releases/<version number>/vendor/composer/../../App/Helpers/DateHelper.php): failed to open stream: No such file or directory

At first I thought it was simply because Laravel recognize the path to DateHelper as App/Helpers/DateHelper.php instead of app/helpers/DateHelper.php, so I tried to change the pathname in composer.json's autoload from "App" to "app". After I changed it, I tried to clear the cache by running php artisan config:cache, then I got this error.

PHP Fatal error:  require(): Failed opening required '/var/www/html/<app name>/releases/<version number>/vendor/composer/../../App/Helpers/DateHelper.php' (include_path='.:/usr/share/php') in /var/www/html/<app name>/releases/<version number>/vendor/composer/autoload_real.php on line 71

The same goes for when I was running any composer command (composer install, update, or dump-autoload). I tried searching for a config.php file, as suggested by this post, in my project's bootstrap/cache/ folder but the folder turns out to be empty. What's worse is that running php artisan or any php artisan command would also result in the same PHP Fatal Error. Any ideas as to what is causing this?

Thank you in advance.

0

There are 0 best solutions below