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

Belhedi's avatar

How to fix “ No such file or directory”error when I access to the home page

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

0 likes
20 replies
aurawindsurfing's avatar

It is your setup and not your project. To make sure you actually have everything installed correctly try creating a simple laravel test projects with laravel new testprojects and then accessin it depending on your setup by localhost:8000 or testproject.test etc.

When you get this to work get back to your project in question.

Belhedi's avatar

when I create a simple laravel test project it works but I want to edit the dowloaded project mate !

mware's avatar

Did you run 'composer install' after downloading the project? Typically, when you clone a project from GitHub you will still have to run 'composer install' in the root directory to pull in all the dependencies. You might even have to create a .env file and run 'artisan key:generate' to get the project up and running.

Belhedi's avatar

hello my friend first , thanks for your reply second i work as a freelancer and my work is to edit a website , this website is hosted in godaddy.com than i tried to download this website from godaddy and edit him from my computer and I tried to the command composer instal and composer update and still not working...

bugsysha's avatar

If you take a closer look than you'll notice there is an issue with difference in path notation for operating systems.

On Windows DIRECTORY_SEPARATOR is backslash \, and on Unix based systems it is slash /. Not the one from GnR :D

So in your case it is using Windows notation until this point C:\Users\Rafaa\Downloads\Compressed.idea, and after that it is switching to what is defined in the server.php file on line 21 which is /public/index.php.

I have never tried web development on Windows so I'm not sure I can help you without Google myself. So please try to search something related to that and I'm sure you will find a solution for your problem.

Snapey's avatar

try it without the period in the folder (Compressed.idea)

Belhedi's avatar

Didn't work guys , PS: I downloaded the whole project from godaddy hosting, Is there any change of settings when doing this operation ?

Snapey's avatar

So when a site is on shared hosting, people have done ugly hacks to make it work.

From the error, it seems like you are running php artisan serve from the root folder. This looks for index.php in the public folder.

Do you have a public folder? It may have been renamed public_html or htdocs. Worse, the index.php file may have been copied to the root of the project and edited to fix the paths.

Search for the index.php and tell us where it is located (there may be more than one)

Do artisan commands work? you should check the version of the application, and also run the various clear commands to wipe any cached items

Belhedi's avatar

I don't know my friend if you understand my problem or not , I should edit an application or website hosted in godaddy.com so I tried to download it and edit it from my localhost and then I will reupload it in the hosting.

Second, the index.php folder is in the root folder.

Artisan commands like artisan serve works but when I type out the adress of localhost:8000 it show me the errors in the top .

I tried to run the make:migration command and worked !

The version is 5.8.

I don't know various commands mate !

Snapey's avatar

OK so your problem is because some fool moved index.php to the root folder.

Do you have a public folder? I did ask this question.. I think it is you that is not understanding.

Belhedi's avatar

Sorry mate , yes I have a public folder

siangboon's avatar

is the php and laravel same version as your environment?

Belhedi's avatar

well his version is 5.8 and mine is 5.7 but there's no diffeent no ?

Snapey's avatar

You might be able to get it going by editing server.php and removing /public from the path on line 21

There's no telling what else has been changed though

1 like
Belhedi's avatar

thanks body it worked but the bootstrap is gone the design is gone :(

siangboon's avatar

just check console and update all the path accordingly.

Please or to participate in this conversation.