Home > Backend Development > PHP Tutorial > How does a smart device access the TP interface on the PC within the same LAN?

How does a smart device access the TP interface on the PC within the same LAN?

WBOY
Release: 2016-10-18 08:56:01
Original
1091 people have browsed it

The device and the computer are in the same network segment. There is an existing smart device that needs to access the thinkphp interface.
Normal access to this interface on a computer is:
http://localhost/demo/index.php/C/A
or:
http://127.0.0.1/demo/index.php/C/A
So how can smart devices access the interface?
Tried to access via IP, but the message appears: You don't have permission to access on this server.
Modified Apache's httpd.config file:

<code>< Directory / >
     Options FollowSymLinks
     AllowOverride None
     Order deny,allow
     Deny from all
< /Directory ></code>
Copy after login
Copy after login

Still no permissions. Is it related to the firewall?
Or if you use a computer to broadcast WiFi and allow the device to connect to WIFI, this situation will not occur?

Reply content:

The device and the computer are in the same network segment. There is an existing smart device that needs to access the thinkphp interface.
Normal access to this interface on a computer is:
http://localhost/demo/index.php/C/A
or:
http://127.0.0.1/demo/index.php/C/A
So how can smart devices access the interface?
Tried to access via IP, but the message appears: You don't have permission to access on this server.
Modified Apache's httpd.config file:

<code>< Directory / >
     Options FollowSymLinks
     AllowOverride None
     Order deny,allow
     Deny from all
< /Directory ></code>
Copy after login
Copy after login

Still no permissions. Is it related to the firewall?
Or if you use a computer to broadcast WiFi and allow the device to connect to WIFI, this situation will not occur?

Deny from all? Change it to allow from all and try it

  1. Check whether the IP of your mobile phone and the computer are in the same network segment, and then use PC to ping your mobile phone IP in the same network segment. If the ping fails, it means that the router has implemented intranet APR isolation. If the connection cannot be connected, you can try PC if possible. Build a hotspot

  2. httpd configuration, do not write ServerName, write *

  3. Please clear out the deny first, this is the blacklist setting

It should work. Try changing 127.0.0.1 to the IP address of your computer

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template