简体   繁体   English

localhost 拒绝连接 Xampp 问题

[英]Localhost refused to connect Xampp issue

i am trying to connect my site from others computers on local network.我正在尝试从本地网络上的其他计算机连接我的站点。 I can access the site from my system IP address but issue is this when i entered the username and password it will redirect the page from 192.168.0.2/ppp/login to localhost/ppp/auth/login and shows thee error localhost refused to connect.我可以从我的系统 IP 地址访问该站点,但问题是当我输入用户名和密码时,它会将页面从 192.168.0.2/ppp/login 重定向到 localhost/ppp/auth/login 并显示错误 localhost 拒绝连接.

localhost usually points to 127.0.0.1 . localhost 通常指向 127.0.0.1 。 So, if you are getting redirected to localhost/login/ppp then the issue with your site's code.因此,如果您被重定向到 localhost/login/ppp,那么您的站点代码就会出现问题。 Don't redirect to http://localhost/login/ppp .不要重定向到http://localhost/login/ppp Just do a redirect to /login/ppp instead.只需重定向到 /login/ppp 即可。

The reason connection is refused is because the other PC doesn't have XAMPP (or any other web server) running on it.连接被拒绝的原因是另一台 PC 上没有运行 XAMPP(或任何其他 Web 服务器)。

your only need to change the config.php file in controllers.您只需要更改控制器中的 config.php 文件。 write your IP instead of localhost.写你的 IP 而不是 localhost。 Your code will run properly on network.您的代码将在网络上正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM