简体   繁体   English

MySQL和PHP Microsoft Windows错误-知道发生了什么吗?

[英]MySQL and PHP Microsoft Windows Error - Any idea what's happening?

I'm running the following code: 我正在运行以下代码:

<?php
    $dbc = mysql_connect('myforeignserver.wisc.edu:3306','mydb','mypassword');
    echo "This Works";
?>

Instead of generating a this works, like it should, I get a windows bar which pops up and says Apache HTTP Server stopped working and was closed. 我没有出现一个正常运行的窗口,而是弹出了一个窗口栏,说Apache HTTP Server停止工作并被关闭。 I really have no idea what the issue is. 我真的不知道问题是什么。 Please help! 请帮忙! thank you! 谢谢!

The arguments that mysql_connect take are ( php.net/mysql_connect ): mysql_connect接受的参数是( php.net/mysql_connect ):

resource mysql_connect ([ string $server = ini_get("mysql.default_host") [, string $username = ini_get("mysql.default_user") [, string $password = ini_get("mysql.default_password") [, bool $new_link = false [, int $client_flags = 0 ]]]]] )

Basically: 基本上:

$con = mysql_connect("myforeignserver.wisc.edu:3306",$username,$pass);
if($con)
{
    echo "Successfull connection!";
}
else
{
    echo "Connection Failed!";
}
mysql_select_db("mydb",$con);

Hopefully that should set you going the right direction :o) 希望那应该设定正确的方向:o)

You may also want to take a look at this w3schools tutorial 您可能还想看看这个w3schools教程

The "This application has crashed" popups in Windows usually have a "more details" button that'll give you some extra information about the crash, particularly which exe/dll the crash occured in. If that's not available, then the crash should have been recorded in the system logs, which you can get at with eventvwr , usually under "Windows Logs -> Application". Windows中的“此应用程序已崩溃”弹出窗口通常具有“更多详细信息”按钮,该按钮将为您提供有关崩溃的其他信息,尤其是崩溃发生在哪个exe / dll中。如果不可用,则崩溃应具有记录在系统日志中,您可以使用eventvwr获得该日志,通常在“ Windows日志->应用程序”下。

Without any more details about the crash, that's about all you'll get for help from here. 如果没有有关崩溃的更多详细信息,那么您将在这里获得所有帮助。 There's just not enough information and far too many possibilities. 信息不足,可能性太多。 Firewall, bad dll, corrupted exe, blah blah blah... 防火墙,错误的dll,损坏的exe,等等等等...

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

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