【问题标题】:How can I access website on Mac localhost PHP server from an iPhone on the same network?如何从同一网络上的 iPhone 访问 Mac localhost PHP 服务器上的网站?
【发布时间】:2018-10-28 08:42:08
【问题描述】:

我的 Mac 的 IP 是 192.168.1.122,服务器位于端口 8000。我尝试使用 iPhone 连接到它

http://192.168.1.122:8000/index.php
http://<name>.local:8000/index.php
both of the above without the "http://"

注意去

http://<name>.local

有效,显示“有效!”的页面

如何在 iPhone 上查看网站文件?

编辑:http://localhost:8000/index.php 按预期在 Mac 上工作

【问题讨论】:

    标签: php server localhost


    【解决方案1】:

    根据一个类似但不同的问题想出来:

    使用命令打开PHP服务器

    $ php -S 0.0.0.0:8000
    

    然后,您可以通过连接到同一网络的任何设备上的任何浏览器访问它,方法是输入主机的 IP:8000,而不是 0.0.0.0:8000

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 2011-08-05
      • 2015-04-15
      • 1970-01-01
      • 2020-02-24
      • 2011-01-07
      • 2020-07-06
      相关资源
      最近更新 更多