[英]How to fix WAMP page access when using IP Address instead of localhost in the URL
I have recently built my local test server WAMP by using Windows 7 Pro 64bit OS. 我最近通过使用Windows 7 Pro 64位OS构建了本地测试服务器WAMP。 I have also chosen to use the 32bit programs (Apache, MySQL & PHP) so my WAMP spec would be x86 V11 binary Thread Safe (TS). 我还选择使用32位程序(Apache,MySQL和PHP),因此我的WAMP规范为x86 V11二进制线程安全(TS)。 I want to keep all development related items into the C:\\dev folder or directory, so my file system looks like this: 我要将所有与开发相关的项目保留在C:\\ dev文件夹或目录中,因此我的文件系统如下所示:
C:\dev\bin\apache24\
C:\dev\bin\MySQL5.6\
C:\dev\bin\PHP5.6\
C:\dev\www\phpMysqlAdmin
C:\dev\www\HollyGhost.com\login.php
Settings: my.ini 设置:my.ini
# Path to the installation directory.
basedir = "C:/dev/bin/MySQL5.6/"
# Path to the database data directory
datadir = "C:/dev/bin/MySQL5.6/data/"
# The TCP/IP Port the MySQL Server will listen on
port = 3306
# Server Id.
server_id = 1
C:\Winows\System32\drivers\etc\hosts
127.0.0.1 localhost
If I need to view the web site: http://localhost/HollyGhost.com/login.php
the site comes up without any issues and works great; 如果我需要查看该网站: http://localhost/HollyGhost.com/login.php
该网站可以正常运行,并且没有任何问题。 but if I rewrite the URL on the same box to: http://127.0.0.1/HollyGhost.com/login.php
the site renders the login page but I cannot log into the system. 但是,如果我在同一框中将URL重写为: http://127.0.0.1/HollyGhost.com/login.php
: http://127.0.0.1/HollyGhost.com/login.php
该网站将显示登录页面,但我无法登录系统。 All I am getting when I attempt to log in is the login page keeps refreshing. 尝试登录时,我得到的只是登录页面不断刷新。 I tried to do the same from another PC and I am getting the same result. 我试图在另一台PC上执行相同的操作,但得到的结果相同。 I need to do this so I can test other devices locally. 我需要这样做,以便可以在本地测试其他设备。
Any help is greatly appreciated. 任何帮助是极大的赞赏。 I am not sure if this issue is a permission problem based on the fact that MySQL data is stored in the \\MySQl5.6\\data
directory. 基于MySQL数据存储在\\MySQl5.6\\data
目录中,我不确定此问题是否是权限问题。 If so, how do I go about fixing it. 如果是这样,我该如何解决它。
The problem was in the Windows Firewall -> Advance setting -> Inbound Rules. 问题出在Windows防火墙->高级设置->入站规则中。 The Inbound Rules for MySQL Profile was set to Private and the Program was set to Any. MySQL配置文件的入站规则设置为私有,程序设置为任何。 I change Profile to "Domain, Private" and set Program to point to MySQL installation directory "MySQL.exe" this works for me after rebooting all network devices and PCs. 我将配置文件更改为“域,专用”,并将“程序”设置为指向MySQL安装目录“ MySQL.exe”,这在重新启动所有网络设备和PC之后对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.