3

I am using windows 10 and wamp server and I am fresh installing laravel and all i get is this error message and is it necessary to do php artisan serve everytime i open laravel ? as long as i close cmd prompt localhost:8000 refused to connect .

Php artisan serve error Php artisan serve error

McGrady
  • 10,869
  • 13
  • 47
  • 69
designerdarpan
  • 197
  • 1
  • 3
  • 19

3 Answers3

4

I think you are running a Laravel project blog by command php artisan serve and you are browsing your application by localhost:8000 or 127.0.0.1:8000

Your screenshot saying that when you are trying to visit a url which is not defined in your routes/web.php then, you are getting invalid request (Unexpected EOF) error in your cmd.

And of course! in this case when you close cmd then your Laravel app will not run.

So now, if you don't want to run your Laravel app by the following command each time, then you can use Laragon in windows environment.

Awolad Hossain
  • 1,007
  • 13
  • 18
  • 1
    I have the exact same problem and Im NOT trying to browse to any other url, Im just idling on index page and these errors occur. Have you a solution for that? I tried php artisan cache:clear but did not resolve the issue. By the way, OP's screenshot does not say he is trying to browse to any url aswell, be careful on what you say. – DevMoutarde Apr 26 '17 at 20:14
  • @designdarpan I tried it, didn't help.. not a big deal tho since its not a critical error ! I think (as explained in another topic) it has to do with google chrome and its network prediction feature as 'kenorb' says at http://stackoverflow.com/questions/29141240/php-local-server-invalid-request-unexpected-eof. I'll let this down for now – DevMoutarde Apr 27 '17 at 08:24
0

Either you have to run php aritsan serve or set up a virtual host in your OS. Here is how to set up a virtual host in Ubuntu 16.04: How To Set Up Apache Virtual Hosts on Ubuntu 16.04

Mehrud
  • 181
  • 3
0

This is case, you can keep your cmd open. And open another cmd, redirect to file path where you are working and it should work fine.