Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class log does not exist in Laravel

Tags:

php

laravel

I'm managing a legacy project that uses Laravel 5.1 and php7, it is running in CentOS.

Right now I'm trying to run it in a test enviorment using ubuntu 14.04 and php5 or Centos with php7, but there's no way I can figure out why I'm getting this error when trying to run the project.

    PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class log does not exist' in /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php:1291\nStack trace:\n#0 
    /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1291): ReflectionClass->__construct('log')\n#1 
    /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1242): Illuminate\\Container\\Container->build('log', Array)\n#2 
    /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1780): Illuminate\\Container\\Container->make('log', Array)\n#3 
    /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1334): Illuminate\\Foundation\\Application->make('Psr\\\\Log\\\\LoggerI...')\n#4 
    /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1318): Illuminate\\Container\\Container->resolveClass(Object(ReflectionParameter))\n#5 /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1304 in 
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php on line 1291, referer: 
    http://localhost/versioned/software/track2/

Site is working in production, and I have copied the exact same files

Env file:

server=localhost
APP_KEY=secret
key=secret
web_database=db1
web_username=root
web_password=pwd
admin_user=d32d32d233d2
padding_top=5% 
like image 305
user1532587 Avatar asked Dec 07 '25 21:12

user1532587


1 Answers

This might happen because you have a wrong value in one of the config files or spaces in your .env file.

If you need spaces in your .env file, use ENV_KEY='some value here' instead.

More info here:

https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist

like image 198
Davor Minchorov Avatar answered Dec 09 '25 14:12

Davor Minchorov