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

jsonkenyon's avatar

Laravel Error on After Changing PHP version to 7.0.3

Laravel seems to work just fine running PHP 5.6, but as soon as I add the following to change to PHP 7

Use PHP 7.0.3 as default

AddHandler application/x-httpd-php70 .php

Appears to break things, but commenting/renaming the .htaccess file fixes it. Fatal error: Uncaught ReflectionException: Class log does not exist in /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php:738 Stack trace: #0 /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): ReflectionClass->__construct('log') #1 /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build('log', Array) #2 /home/forres12/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array) #3 /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php(853): Illuminate\Foundation\Application->make('log') #4 /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php(808): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php(777): Illuminate\Container\Container->getDependencies(Array, Array) #6 /home/forres12 in /home/forres12/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 738

I have also tried to do a clean install, and still getting this error. But again as soon as I change to 5.6 all is well again.

0 likes
4 replies
eszterczotter's avatar

I have Laravel working on PHP7 though I'm not sure what the exact patch version is (and can't check it now). I don't remember having issues switching it.

jsonkenyon's avatar

Thanks for your reply, I'm currently at this time recompiling php 7.0.2 on the server, going to switch to that once it is complete. I know I had it running that on my old server, going to check and hope for the best. Will update with a update.

jlrdw's avatar

Meanwhile does anyone know what the problem with that version of PHP would be, it would be a great help to all?

jsonkenyon's avatar
jsonkenyon
OP
Best Answer
Level 19

@jlrdw I'm not 100% convinced that it would be a php version, more or less a configuration issues. I'm working on it but not really making any progress. But would be great if someone has php7.0.3 to replicate a new install on.

Please or to participate in this conversation.