简体   繁体   中英

How to fix failed to open stream?

So i'm getting this warning and i have no clue how to fix it. Its for my connect file to my database.

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

My connect file look like this:

<?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);
}
?>

Can anyone help?

The path you specified is incorrect. The file doesn't exists or can not be found in the folder. It might be on a higher level. (../)

The mysql extension is no longer supported, please take a look at the mysql_i extension or PDO. Mysql is deprecated and vulnerable to SQL-injection.

Mysql_i

PDO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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