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

akaleniu's avatar

Php artisan serve not working

Hi, this is my first discussion, and I need your help, I'm following the laravel 5.7 from scratch series, and everything was working fine until one day I tried to run php artisan serve command and when I tried to load http://127.0.0.1:8000 it stays loading the page and never shows the page, and in command line it shows: Laravel development server started: http://127.0.0.1:8000. Can anyone help me please? I really want to finish the series. Thank you!!!

0 likes
14 replies
Tray2's avatar

Is the page just white or is it really loading?

If you are on linux or osx try sudo chmod -R 775 storage

akaleniu's avatar

@TRAY2 - It does not stops loading, and does not show anything, I am on Windows and already change permissions

deepu07's avatar

what is the status code you are seeing in console?

jlrdw's avatar

what happens if you try

php -S localhost:8000 -t yoursite/

Replace yoursite with your actual name.

Also try giving PHP Artisan serve a name like above I'm on mobile now don't have access to all the commands.

1 like
diegoaurino's avatar

As @jlrdw suggested, try php -S localhost:8000 -t public to see if the PHP built-in server can run your app, but point it to your public folder and not to your app root directory or app name.

In other words, go to your app folder and run the following command:

php -S localhost:8000 -t public/

Then open localhost:8000 in your browser.

Check: https://www.php.net/manual/en/features.commandline.webserver.php

If the command above works, chances are that the problem is in your artisan installation.

Also, check if ps aux | grep -i port and ps aux | grep -i artisan return something strange.

If the problem persists, I would suggest you delete and reinstall your vendors folder.

Let me know if it helps.

akaleniu's avatar

@DIEGOAURINO - I did what you guys suggested:

c:\xampp\htdocs\laravel\proyecto>php -S localhost:8000 -t public/ PHP 7.2.12 Development Server started at Sat May 11 16:59:42 2019 Listening on http://localhost:8000 Document root is C:\xampp\htdocs\laravel\proyecto\public Press Ctrl-C to quit.

Then I go to http://localhost:8000, it shows me the laravel page, great!!!

Now, as I said, I was following the laravel from scratch series and in episode 8, we should create controllers and also create a folder inside views, I did that and when I try to go to http://localhost:8000/projects it shows an error:

BadMethodCallException Method App\Http\Controllers\ProjectsController::index does not exist.

Any suggestions? thanx again!!!

akaleniu's avatar

I solved it!!!! I was writing return view('projects.index'); inside the model and not inside the controller!!! now everything works!

Now, one thing that is not clear to me, from now on should I use the command php -S localhost:8000 -t public/ instead of php artisan serve?

Because in every app that I build I have the same problem with php artisan serve.

Thanks!!!

jlrdw's avatar

You have to have your routing setup.

Jashandeep1229's avatar

Hello I am using a mac computer any command of laravel not working on the terminal but its work fine on the web browser (localhost:8080/filename)

when I run any command like PHP artisan serve its got an error unknown database

Please or to participate in this conversation.