dsvjw20866 2012-09-13 07:11
浏览 232

YII php框架localhost有效但127.0.0.1没有

I'm following a book "Agile Web Application Development with Yii" and I am setting up a database connection to the Yii application through an application component.

I followed the books instructions and said the mysql db host is 127.0.0.1. I ran a test and it failed to connect.

Then I changed the host to "localhost" and it works.

Does anyone know why this is the case?

  • 写回答

2条回答 默认 最新

  • dsaf415212 2012-09-13 08:12
    关注

    Check the file name host at this location

    C:\WINDOWS\system32\drivers\etc
    

    Check the default value of localhost in the host file, by default it should be 127.0.0.1 if not, change it to 127.0.0.1. Now try to access your wamp server by using 127.0.0.1 on any web browser.

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记