【问题标题】:How to fix failed to open stream?如何解决无法打开流?
【发布时间】:2016-11-06 11:32:39
【问题描述】:

所以我收到了这个警告,但我不知道如何解决它。它用于我将文件连接到我的数据库。

Warning: require(includes/connect.inc.php): failed to open stream: No such file or directory in /customers/5/e/6/gixter.dk/httpd.www/index.php on line 4 Fatal error: require(): Failed opening required 'includes/connect.inc.php' (include_path='.:/usr/share/php') in /customers/5/e/6/gixter.dk/httpd.www/index.php on line 4

我的连接文件如下所示:

<?php
$conn_error = 'Cound not connect to database.';

$mysql_host = 'xxxxx';
$mysql_user = 'xxxxx';
$mysql_pass = 'xxxxx';
$mysql_db = 'xxxxx';

if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass) or !@mysql_select_db($mysql_db)){
    die($conn_error);
}
?>

谁能帮忙?

【问题讨论】:

    标签: php mysql stream


    【解决方案1】:

    您指定的路径不正确。该文件不存在或在文件夹中找不到。它可能处于更高的水平。 (../)

    不再支持 mysql 扩展,请查看 mysql_i 扩展或 PDO。 Mysql 已弃用且易受 SQL 注入攻击。

    Mysql_i

    PDO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-27
      • 2021-05-15
      • 2017-07-10
      • 2010-11-18
      • 2011-08-30
      • 2020-03-26
      • 2017-03-01
      • 2021-07-31
      相关资源
      最近更新 更多