首页 > 解决方案 > Not able to access localhost on android device on the same network

问题描述

I have installed apache2 on ubuntu and then using it to setup localhost which although can be accessed on the same computer but not on the android on the same network. I remember i could do this previously but now it isn't happening. I want to send files to my android through localhost quickly. Any solution?

标签: androidubuntulocalhostapache2

解决方案


要从设备访问本地服务器,您应该将代码中的 URL 设置为本地 ip 而不是 127.0.0.1 CMD>ipconfig> (IPv4 地址......

然后连接到同一个网络,一切都很好,或者您可以下载Xampp 作为其支持的 Linux 操作系统,并将自动安装所需的工具,如

Apache2 , Mysql 并支持 MariaDB + PHP + Perl

您可以在此线程中找到有用的答案 如何从我的 Android 设备访问我的本地主机?问

正如它之前回答的那样


推荐阅读