0
votes

I downloaded a laravel project from a shared hosting and I want to edit him in my localhost but when I type out the home adress: localhost:8000/ it shows me those two errors :

Warning: require_once(C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php): failed to open stream: No such file or directory in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21.

Fatal error: require_once(): Failed opening required 'C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21.

then I found a solution which is to remove some code from the server.php

the line :

require_once __DIR__.'/public/index.php';

Become :

require_once __DIR__.'/index.php';

then the error fixed and the website worked in my localhost but the design is gone , it show me a static html website without any color or image or any thing.

1
Have you checked the console to see if there are any errors relating to asset paths and things not being loaded in?GBWDev
there's no error just the line of starting the localhost on port 8000Belhedi Rafaa
try to run composer dump autoload, clear cache for all view route config and see if that helpssomsgod
@somsgod , didn't work !Belhedi Rafaa

1 Answers

0
votes

You are not seeing any images or designs(CSS/JS) probably because your all assets and images are having public folder in url, check the console of browser and see what errors you get.

You will have to remove public for all the urls otherwise you won't be able to run project with php artisan serve