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.

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-03-01 16:50:02
Original
2012 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
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template