0

I have an Ubuntu installation on WSL. Everything was ok the last time I used it to develop the same website. Today I started apache2 and mysql as always but the website is not working. The two lines in apache log file are:

PHP Warning:  include(): Failed opening '/var/www/nailsacademy.test/vendor/composer/../vlucas/phpdotenv/src/Environment/Adapter/PutenvAdapter.phpr/composer/../vlucas/phpdotenv/src/Environment/Adapter/ServerConstAdapter.php' for inclusion (include_path='.:/usr/share/php') in /var/www/nailsacademy.test/vendor/composer/ClassLoader.php on line 444
PHP Fatal error:  Uncaught Error: Class 'Dotenv\\Environment\\Adapter\\PutenvAdapter' not found in /var/www/nailsacademy.test/vendor/vlucas/phpdotenv/src/Environment/DotenvFactory.php:34\nStack trace:\n#0 /var/www/nailsacademy.test/vendor/vlucas/phpdotenv/src/Dotenv.php(49): Dotenv\\Environment\\DotenvFactory->__construct()\n#1 /var/www/nailsacademy.test/app/config/_env.php(13): Dotenv\\Dotenv::create('/var/www/nailsa...')\n#2 /var/www/nailsacademy.test/bootstrap/init.php(12): require_once('/var/www/nailsa...')\n#3 /var/www/nailsacademy.test/public/index.php(3): require_once('/var/www/nailsa...')\n#4 {main}\n  thrown in /var/www/nailsacademy.test/vendor/vlucas/phpdotenv/src/Environment/DotenvFactory.php on line 34

Thank you in advance for your help!

miken32
  • 42,008
  • 16
  • 111
  • 154
Fabio Sasso
  • 145
  • 1
  • 12

2 Answers2

0

Dotenv wasn’t autoloaded properly -- which means something likely went wrong with Composer.

I suggest making sure Composer is working as expected, run composer install and then verify that vlucas/phpdotenv is in your vendor folder.

Jared Dunham
  • 1,467
  • 2
  • 17
  • 29
0

I had same issue due to entire project files are replace with new project then i tried following step,

  1. I have take backup of vendor folder and then run composer install command in terminal.

  2. then try to run project again and its working fine. Then removed backup vendor folder.

Sujay
  • 588
  • 6
  • 15