简体   繁体   中英

Running php artisan server with LAN host not working

I'm trying to access my Laravel project APIs on my mobile phone. Since both my machine and mobile are under the same Wi-Fi, I'm trying to run the php artisan serve on my LAN like so.

php artisan serve --host=192.167.1.101

This runs fine and I do connect, but no API calls to the server go through. It doesn't even log a call.

This seems to work just fine when I use my mobile internet and hotspot my machine. But this is not convenient as my mobile internet is very limited.

I've boiled it down to be an issue with the LAN. But that's as far as my knowledge goes.

Is there anything I need to enable?

Thanks.

After months, I've finally found the solution. Turns out my Firewall was set to not trust my WiFi network (which I use for my LAN).

As soon as I added it to the trusted list, everything works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM