How can I access my localhost from my physical Android device?

916

Try this:

php artisan serve --host 0.0.0.0 --port 80

Just make sure that the port is free.

Reference: https://stackoverflow.com/a/30675683/5192105

Share:
916
MHDEZ
Author by

MHDEZ

Updated on December 20, 2022

Comments

  • MHDEZ
    MHDEZ over 1 year

    I have seen this question

    I am creating a flutter app and restful API with Laravel. it is work on AVD with url = "10.0.2.2:8000". and my browsers on computer url = "localhost:8000". I turned off the firewall on windows 10. I can access to Xampp dashboard from my phone's browser "192.168.1.8:80" , but it doesn't work with port 8000

    My computer Ip

    Xampp server

    • Sachin Bahukhandi
      Sachin Bahukhandi almost 4 years
    • MHDEZ
      MHDEZ almost 4 years
      great it is work thanks a lot
    • Sachin Bahukhandi
      Sachin Bahukhandi almost 4 years
      Sure I shall post this as an answer for anyone who visits this in future.
    • Abiye Chris. I. Surulere
      Abiye Chris. I. Surulere almost 4 years
      you also use ngrok
  • Sachin Bahukhandi
    Sachin Bahukhandi almost 4 years
    It goes on to listen on default port 8000.
  • Jeremy Caney
    Jeremy Caney almost 4 years
    While it’s acceptable to provide command-only answers, it’s often more useful for the community if you can also provide an explanation of the command and help people understand why it addresses the problem. That can reduce the number of follow-up questions, and help new developers understand the underlying concepts. Would you mind updating your question with additional detail?