在 MAMP 上运行 indexphp 时没有连接服务器
我必须首先告诉你们,我是网络开发的新手,但我刚刚接到一项维护网站的任务。我复制服务器上的所有重要文件,并将我的计算机设置为带有 MAMP 的本地主机。当我尝试在浏览器上运行页面 index.php 后,它显示了类似“无连接服务器”的结果。我不明白为什么它会这样向我展示。我已经通过创建 test.php 来测试我的本地主机,以执行诸如 echo 之类的测试,并且工作正常。
有谁知道我该如何解决这个问题? 谢谢, 问候
I have to tell you guys first that I'm a newbie of web development but I just got an assignment to maintain website. I copy all important files on server and set my computer to be a localhost with MAMP. After I try to run page index.php on browser but it show me a result like "NO Connect Server". I dont get it why it show me like that. I has tested my localhost by create test.php to do something for testing like echo and it works fine.
Does anyone know how can I fix this problem?
Thanks,
regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从表面上看,没有真正的方法可以判断真正的问题是什么。我能想到的唯一的事情就是常见的:MySQL服务器实际上没有运行,用户名或密码错误,或者用户名实际上没有在系统中注册。抱歉,我无法提供更多详细信息,但是如果您将 NO connect Server 替换为 mysql_error() ,您可以找到更多信息,如下所示:
$db = mysql_connect('localhost','username','passwort') or die( mysql_error());
当脚本终止时,这将打印出错误文本。有了这些信息,您就可以开始解码实际发生的情况。
From what it looks like, there is no real way to tell what the real problem is. The only things I can think of are the usual ones: the MySQL server isn't actually running, the user name or password is wrong, or the user name isn't actually registered in the system. Sorry that I can't give more details, but you could find more information if you replace the NO connect Server with mysql_error() like this:
$db = mysql_connect('localhost','username','passwort') or die(mysql_error());
That will print out the error text when the script dies. With that information, you can start to decode what is actually going on.