1

php artisan serve not working regularly

am working on a project that was devloped in php 5 and fedora uses 7.2

and all repos for php5 on fedora return 404

php artisan clear-compiled
PHP Fatal error:  Uncaught ReflectionException: Class log does not exist in /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /home/ahmed/Document in /home/ahmed/Documents/svn/osmall/trunk/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741

i tried: 1-the .evn search for errors 2-i tried the composer clear cash and other stuff 3- i searched for a timestamp that might cause issue 4- i tried ... 5- am exhausted ..help

elixenide
  • 44,308
  • 16
  • 74
  • 100
Ahmed
  • 29
  • 1
  • 10
  • What is your actual question? Are you trying to downgrade PHP? If so, why? Also, recent versions of Laravel *require* PHP 7 (for good reason, since all 5.x versions have reached end-of-life). – elixenide Jan 19 '19 at 18:53
  • 1
    It usually only takes an hour or two to convert old code to new. Well spent time in my opinion – Andreas Jan 19 '19 at 19:04
  • 2
    This is not about programming but system administration, rather a question for https://superuser.com/ or https://unix.stackexchange.com/ Or edit the question to "How to upgrade code from PHP5 to PHP7 – Pinke Helga Jan 19 '19 at 19:08
  • so it's all about spending more time in upgrading this app code from php5 to php7 – Ahmed Jan 19 '19 at 19:26
  • 1
    All versions below 7.1 are unsupported. It's a potential security risk not to upgrade. – Pinke Helga Jan 19 '19 at 19:28
  • You might just be missing some required extensions. https://stackoverflow.com/questions/34978828/uncaught-reflectionexception-class-log-does-not-exist-laravel-5-2 Try listing `php -m` on terminal console – Pinke Helga Jan 19 '19 at 19:34

1 Answers1

0

If you really require a php version that old and still want to use an up to date os version (which you should!!)

you can try docker:

docker-compose.yml:

version: "3.5"

services:
   php: 
       image: php:5.6-apache
       ports:
          - 80:80
       volumes:
          - ./:/var/www/html

-> this will limit your one application to use that old php version

wodka
  • 1,320
  • 10
  • 20