where do you define ipadress? What is its value?
Failed to listen on ipaddress:8000 (reason: Cannot assign requested address)
php artisan serve --host=ipaddress --port=8080 it shows: Failed to listen on ipaddress:8080 (reason: Cannot assign requested address)
IP address is my router's ipaddress. I wrote that so no need to define
OK, but you don't answer my question, ipadress is only a text in this cde, if you are on linux, it should be definie in /etc/host or in a dns server if you have one ...
In this code, for privacy, I have hidden it but its there
And you can telnet to ipdress 8080? or 8000 (your port in the titel dffers from the one in the post)
it should be localhost not your router ?
if I used localhost I'm unable to access it on phone...how to access a laravel website on the phone?
if you are on the same network you can access your local machine by using its IP on your network and its port
something like:
192.168.0.2:8080
BTW if you are mac, and using safari. You can plugin your iPhone by cable and using developer menu, access the website directly on the device.
But I'm unable to access using 192.168.0.12:8080 and I don't know why in android phone and hosting in ubuntu using WSL
Did you check what internal IP address your pc has?
maybe try with valet?
And if your are not on the same network, that's probably the case, you have to transfer (NAT rules) on the router.
or serve with ngrok
Because you phone is not on the same network 192.168.0.0-255
no, phone and the local machine are connected to the same network.
see my last post
you can use your local ip address, if your phone and local machine is connected to the same network, your phone should be able to connect to the private ip address of the machine, provided the firewall incoming rule allow the access...
I'm already connected to the same network on both phone and local machine
Are you sure*, does your router see the IP of your phone?
*At the beginning you wrote that ipadress is the router address, but that's no sense on a local network.
How do you host the site when you are developing locally?
You host the site then find the IP address of your server on the local network, then type it into the browser address bar on your phone.
This has NOTHING to do with your router if everything is internal to your network.
Make sure any firewall on your local web server is configured to allow external devices to connect to your machine on whatever port you are using (8000 / 8080 / 80)
If you are using virtual hosts on your webserver then your mobile device will need to have its hosts file altered so that it can access the correct website on your local machine.
OR, use expose from beyondco.de https://beyondco.de/docs/expose/introduction
Please or to participate in this conversation.