1

I just moved my website to a separate server in an attempt to make sure that when I push the site to the production server everything transitions smoothly. Unfortunately, the site appears blank when I visit the link unless I add something like "echo 'hello';" to the index.php page, nothing is being logged in the laravel storage files (even though the permissions are recursively set to 777), and I get this error:

nickstaging@ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error:  Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error:  Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741

I cannot, for the life of me, figure out why it's occurring. It is recorded in the apache log file on the server. The site still runs correctly on my local homestead vm that I have running for general testing, and I tried reuploading all of the files to the server but nothing has worked.

If anyone has any idea why this is occurring, that would be great and I would very much appreciate it! Thanks in advance!

Edit Installing php-mysql did not fix the problem and there was no difference in the error afterwards.

Nick
  • 135
  • 2
  • 10
  • Possible duplicate of [Uncaught ReflectionException: Class log does not exist Laravel 5.2](http://stackoverflow.com/questions/34978828/uncaught-reflectionexception-class-log-does-not-exist-laravel-5-2) – Dekel Jun 08 '16 at 21:22
  • @Dekel It unfortunately isn't. I tried doing the php-mysql install and nothing changed. – Nick Jun 08 '16 at 21:28
  • According to the link, something is missing (not specifically php-mysql). – Dekel Jun 08 '16 at 21:33
  • That could be true but as of right now I'm not finding anything. – Nick Jun 08 '16 at 21:57
  • You should meet ALL the server requirements of laravel to make this work (which include php-mysql, php-pdo, php-mbstring, php-json, php-mcrypt, php-openssl, php-tokenizer). make sure all are installed and enabled. – Dekel Jun 08 '16 at 22:05
  • I was attempting to, and php-json is still missing from that list, but it turned out the problem was related to a service provider not being found correctly. – Nick Jun 08 '16 at 22:14

1 Answers1

2

The most common problem is either you have spaces in your .env file or a wrong value in one of your config files.

More info here:

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

Davor Minchorov
  • 2,018
  • 1
  • 16
  • 20
  • You see, I tried that, but the exact same files are still working correctly in my Homestead environment. But the moment I move them over to the new environment I get that error. I have triple-checked my .env file to make sure there are no spaces and there are none. – Nick Jun 08 '16 at 21:32
  • 1
    So, it turns out that there was an incredibly piece of information in that post that finally helped me solve the issue. [Third post from the top](https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist?page=3) This allowed me to find what exactly was wrong and now things are working as expected! Thanks for linking that! – Nick Jun 08 '16 at 22:06