开发者

No Connect Server when run indexphp on MAMP

开发者 https://www.devze.com 2023-04-03 19:33 出处:网络
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 MA

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 ho开发者_高级运维w can I fix this problem? Thanks, regards


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消