简体   繁体   English

在URL中使用IP地址而不是localhost时如何解决WAMP页面访问

[英]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.

相关问题 当我使用我的IP地址而不是localhost作为URL时出错 - error when i used my ip address instead of localhost as URL 如何使用本地IP地址而不是localhost访问数据库mysql服务器 - How can I access my database mysql server using my local ip address instead of using localhost 使用IP地址而不是本地主机时,上传文件不起作用 - Upload file not working when using ip address instead of localhost 如何使用系统的IP地址代替本地主机来运行在wamp / xampp服务器上运行的项目? - How to run a project running on wamp/xampp server using system's IP address in place of localhost? WAMP 服务器从 ip 地址重定向到 localhost - WAMP Server redirects to localhost from ip address 使用CodeIgniter发送电子邮件时,将IP地址HELO'ing修复为“ localhost.localdomain” - Fix IP address HELO'ing as “localhost.localdomain” when using CodeIgniter to send email 为什么使用IP地址而不是localhost时未加载CSS和JS文件 - Why CSS and JS files are not loaded when using IP address instead of localhost 在mysqli连接中使用IP地址代替“ localhost”作为主机名 - Using IP address instead of 'localhost' as hostname in mysqli connection 如何在PHP Symfony中连接到IP地址而不是localhost? - How to connect to IP address instead of localhost in php Symfony? 是否可以在laravel中使用IP地址而不是localhost? - Is it possible to use Ip address instead of localhost in laravel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM