Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Shahin's avatar

My project can't run on nginx and PHP7

When I run my project it showing this errors :

Fatal error: Uncaught ReflectionException: Class log does not exist in C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php:737 Stack trace: #0 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php(737): ReflectionClass->__construct('log') #1 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php(627): Illuminate\Container\Container->build('log', Array) #2 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('log', Array) #3 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php(838): Illuminate\Foundation\Application->make('log') #4 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php(801): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php(7 in C:\nginx\html\laravel-todo\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 737

how can I solve it?

0 likes
16 replies
karllhughes's avatar

@jlrdw I get the same error with Apache and Nginx or when I run php artisan serve via bash.

jlrdw's avatar

You need to check your code, you probably have an error, I run fine on php 7 rc5 with apache.

jlrdw's avatar

Could it be a folder permissions issue?

Shahin's avatar

@jlrdw My project run perfectly on Apache2. I think my code is right way :) I get error when I run project on Nginx && php7 rc6

jlrdw's avatar

I haven't tried rc6 yet, but please update this post if you figure it out. Only Nginx && php7 rc6, how about apache and rc7?

cyprusglobe's avatar

by chance are you guys using route:cache or config:cache?

i just recently tried php7 and noticed it wasn't working then i removed the caching and it magically started working again

PS: I am using Nginx with php7 and php7-fpm

jlrdw's avatar

I was curious, I installed a bitnami stack with php 7 rc5, it's wamp on windows 10 and of course apache. Laravel ver is 5.1.11, all is working fine on this setup. So it has to be a Nginx problen I'm guessing. Please keep us informed. My other answer was a previous ver of laravel.

1 like
karllhughes's avatar

I got mine working by making sure the PHP extension "mbstring" was enabled. I did it during the PHP7 build process.

Omega81's avatar

mbstring was my trouble as well.

I had the same error, with PHP 7 on my Window Machine, but the same code ran fine on my Ubuntu 14.x. What I found was mbstring was not enabled in my PHP.ini on the Windows PHP 7 install.

extension=php_mbstring.dll

masterpowers's avatar

Class log does not exist
it Means Your Missing a Vendor File The Fixed For That is Completely Remove Vendor file But Make Sure Your Composer.lock is Present Then Run Composer Install It Should Re Install All Missing File in Your Vendor File

alainbelez's avatar

im also using PHP7 with nginx, i also have mbstring install

cloned the laravel repo and did a composer install and the error occured. any fix yet?

clippit's avatar

The error output is too confusing to be related with an extension. But after install PDO extension on my PHP 7, there's no error anymore. Hope it helps:)

Please or to participate in this conversation.