1

Background:

New to laravel Developing on the same network as my brother who is also facing this issue Php Artisan Serve loads my development server, but when I click on it, it never actually loads anything it just indefinitely loads the page. It's VERY temperamental, and normally is fixed by restarting my computer but as of today it seems to have just broken altogether.

If anybody has any ideas it would be GREATLY appreciated as I am really stuck, there seems to be nothing at all on google.

What I have tried so far:

-Using port 8080

-php -S localhost:8000 -t public/ (Worked at first, then "broke" shortly after)

-Composer update

I have just created a brand new laravel project, and php artisan serve works on this, but then sure enough it breaks after sometime as above. What could possibly be going wrong?

Jack Hayward
  • 163
  • 7
  • You have to keep the command line CMD in windows or Terminal in Linux opened. Don't close it. – SaidbakR Apr 09 '18 at 22:04
  • I know, I have been keeping it open the whole time - it has been working for me, but sometimes it just stops. When I close the command line it gives the message that it cannot connect to the localhost, rather than just endlessly trying to load something. – Jack Hayward Apr 09 '18 at 22:10
  • Well, did you have tried to change the port? The port may be conflicted with another application. Also, try to checkout the firewall settings for the specified port. – SaidbakR Apr 10 '18 at 02:29

2 Answers2

0

I recommend you, use XAMPP, put your proyect in htdocs folder, and write localhost/projectname in the browser.

Marlon Adarme
  • 357
  • 4
  • 15
  • Is there no other way to fix it without this workaround? This will really slow down my workflow :( – Jack Hayward Apr 09 '18 at 21:41
  • I'm pretty new to Laravel, but I installed composer before using this, which command do you mean? Is it this one? composer create-project --prefer-dist laravel/laravel blog "5.5.*" – Jack Hayward Apr 09 '18 at 21:52
  • No, when you add dependences to your project, you have to run "composer update", or when you clone a project; you have to run "composer install" to install all the dependences, try running "composer update". – Marlon Adarme Apr 09 '18 at 21:55
  • Ahh! I didn't know that. I have just run the command and 3 items were installed successfully, but the issue still persists. Interestingly, my brother is currently running his website on localhost without problem. Is there any likelihood that both using the same router/internet connection could be problematic? – Jack Hayward Apr 09 '18 at 21:59
  • I don't know, disconnect your computer from internet and try. Do you have something else running in the 8080 port? – Marlon Adarme Apr 09 '18 at 22:02
  • Nothing else running in 8080 as per the resource monitor, I have tried disconnecting before and that did not fix the issue either. – Jack Hayward Apr 09 '18 at 22:09
  • Ask in laracast then. I'm sorry, I could not help you – Marlon Adarme Apr 09 '18 at 22:14
  • It will not be a problem when both computers run on the same network since it's running locally on YOUR and HIS computer. localhost refers to ip: 127.0.0.1 which is your own computer. – killstreet Apr 10 '18 at 09:01
0

If you are working on a MAC I would suggest installing Valet. This will automatically run NGINX and php on the background when your computer starts, so theres no manual starting up time. Along with that, you can "Park" folders where all sub-folders become domains.

For example

  • C:/projects
    • /myfirstproject
    • /playground will have the urls:

myfirstproject.test and playground.test automatically. You can always change the extension of the local domains if you prefer.

If you are using windows you can still use valet using this: https://github.com/cretueusebiu/valet-windows

It works great in my opinion, and is quite handy to quickly spin up a new project and not having to deal with ugly routes.

killstreet
  • 1,251
  • 2
  • 15
  • 37