【问题标题】:I am getting following error while connecting to my database连接到我的数据库时出现以下错误
【发布时间】:2017-02-25 10:23:19
【问题描述】:

连接到我的数据库时出现以下错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@main-hosting.eu to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

php_error.log 文件:

[25-Feb-2017 09:45:09 UTC] PHP Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'mysql.hostinger.in' (4 "Interrupted system call") in /home/u191892126/public_html/API/connect.php on line 8

我的 php 文件:

<?php
$servername = "mysql.hostinger.in";//var deceleration I tried "localhost" too
$username = "u1918921**_root";
$password = "*********";
$dbname = "u191892126_acare";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
?>

【问题讨论】:

  • ini_set('display_errors','On'); 启用错误并查看正确的错误
  • 错误描述了问题!您必须联系您的托管服务提供商:)
  • 感谢您的帮助 Pranav MS 和 Hassan Ahmed。是的,我尝试联系电子邮件 ID,它显示错误电子邮件不存在
  • @PranavMS OP 发布了 http 服务器错误日志文件的内容,这比试图在 html 标记中盲目地注入错误消息更有意义。
  • 致电支持并要求他们重新启动服务并尝试。

标签: php mysql internal-server-error


【解决方案1】:

这是服务器的错误,再次尝试(花了 4 小时),一切正常。

【讨论】:

    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 2019-04-19
    • 2019-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-26
    • 1970-01-01
    相关资源
    最近更新 更多