Home > Backend Development > PHP Tutorial > I use wamp to run the php program. By default, localhost can access it. But if I change it to the local IP, it won't work.

I use wamp to run the php program. By default, localhost can access it. But if I change it to the local IP, it won't work.

WBOY
Release: 2023-03-01 16:50:02
Original
1950 people have browsed it

localhost can access the local server
Changing to the local IP will not work, prompting a 403 error

Reply content:

localhost can access the local server
Changing to the local IP will not work, prompting a 403 error

Configure the hosts file 127.0.0.1 localhost ::1 localhost

Assume local IP: 192.168.31.81

hosts file

<code>127.0.0.1   192.168.31.81
</code>
Copy after login

httpd-vhosts.coonf

<code><VirtualHost *:80>  
    DocumentRoot "F:/wamp/www/XXXX/"
    ServerName 192.168.31.81
    <Directory "F:/wamp/www/XXXX/"> 
        Options Indexes FollowSymLinks 
        Order allow,deny 
        Allow from all 
    </Directory> 
</VirtualHost>
</code>
Copy after login
Related labels:
php
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