I face this error only when "php artisan serve" command is not running. If this command is running then there is no such a error, but as i closed command prompt this error occurs. i have also changed port but no vain. Kindly help me.I would like to mention here that I'm using Window 10 OS. Thanks in advance.
-
This is a localhost issue. What are you using for localhost? – pr1nc3 Feb 20 '19 at 13:28
-
1`php artisan serve` runs the server, so if you don't have it running, there is no server to connect – Flash Thunder Feb 20 '19 at 13:30
-
I'm using XAMPP – Programmer Feb 20 '19 at 13:31
-
`netsh http add iplisten 127.0.0.1` can you try this command in your xampp console? Let me know if it works after – pr1nc3 Feb 20 '19 at 13:31
-
What port are you trying to connect to? artisan serves on port 8000 by default, XAMPP likely uses 80.. – Devon Bessemer Feb 20 '19 at 13:34
-
Ali but laravel is trying to connect through the artisan on other port – Flash Thunder Feb 20 '19 at 13:34
-
Xampp console ? i don't know about it.Is it CMD ? if not then kindly guide me how to access it. – Programmer Feb 20 '19 at 13:35
-
i'm using http://127.0.0.1:8000 – Programmer Feb 20 '19 at 13:35
-
Flash Thunder bro then whats solution ? Can't i run it on localhost using XAMPP ? Is it compulsory to run "php artisan serve" command untill i'm working with laravel ? Is there no any solution ? – Programmer Feb 20 '19 at 13:38
-
@AliBhutta https://stackoverflow.com/questions/28788285/how-to-run-laravel-without-artisan – Flash Thunder Feb 20 '19 at 13:44
-
The solution is to not use port 8000... Use the port XAMPP is configured on if you want to use XAMPP.. – Devon Bessemer Feb 20 '19 at 15:04
3 Answers
If you don't have a HTTP server (like WAMP or similar installed), you'll need to keep the Command Prompt / Terminal window running at all times. Closing the window or stopping the php artisan server
command will terminate the server that's running the website.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the php artisan serve
command.

- 15,087
- 3
- 41
- 60
-
-
If you're already using XAMPP then no need to use `php artisan serve`. Make sure XAMPP is configured correctly to point to your Laravel project and, including port number. Add details on your XAMPP configuration to your question so we can help further. – Niraj Shah Feb 20 '19 at 15:08
-
@ Niraj Shah how to Add details on myXAMPP configuration ? kidnly guide me Thanks – Programmer Feb 21 '19 at 04:42
-
I don't use XAMPP. Please consult the documentation or visit the XAMPP website for help. – Niraj Shah Feb 21 '19 at 10:59
because with this kind of server (like: LARAGON), running 'php artisan serve' is necessary, so if you close the terminal, 'php artisan serve' will automaticaly stop running, then the server will stop too, then you can't reach anymore your localhost.

- 74
- 3
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the
php artisan serve command

- 11
- 1
- 3