Using Laravel artisan and PHP built-in server
Simply running
php artisan serve --host 0.0.0.0
This command will set up a PHP built-in server and will listening to the default port of 8000 to avoid any conflict, so if your ip address is 192.168.1.1, you can access your local environment via mobile device by 192.168.1.1:8000
However if you wish to listen to the Http default port of 80, you can also define as by adding 1 parameter into it, still you need to make sure no other server is running on that port.
php artisan serve --host 0.0.0.0 --port 80
Now you can access by simply typing in the ip address of : 192.168.1.1
*Note: If you use MacOS, you can find out your ip address by accessing System Preferences / Network and look at the wifi ip address.
0 Comments:
Post a Comment