# Warning: mysqli::\_\_construct(): (HY000/2002): No such file or directory in /home/vol1000\_5/epizy.com

**URL:** <https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106>\
**Category:** Hosting Support\
**Created:** [October 10, 2022, 11:02pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106 "2022-10-10T23:02:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon98844982](https://forum.infinityfree.com/letter_avatar/anon98844982/32/6_449c533f586939b6e5f246632a46421f.png) [@anon98844982](https://forum.infinityfree.com/u/anon98844982)\
**Post date:** [October 10, 2022, 11:02pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/1 "2022-10-10T23:02:56Z")

</div>

[https://wowsod.ml](https://wowsod.ml)

(hello i have this problem with this error and i don’t know how to solve it.t)

i got this error when i am installing my website and i have this error i don’t know what it means but someone could tell me about this i give screenshot

when I uploaded the files to filezilla to the web site they loaded completely.

here the error

 ![for help](https://forum-cdn.infinityfree.net/original/3X/f/d/fdbd3107911b0d339f8ab83986d15c012c9e9ae6.png)

![for help 2](https://forum-cdn.infinityfree.net/original/3X/9/f/9f657ef8e52ce1d77fe147ffff6f1449279dec7c.png)  
i was checking the scripy my sql and everything was correct what should i do?

HELP

😶

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [October 10, 2022, 11:05pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/2 "2022-10-10T23:05:10Z")

</div>

Can you copy paste the contents of the /core/web\_req\_init.php file here?

---

<div class="post-metadata">

**Author:** ![anon98844982](https://forum.infinityfree.com/letter_avatar/anon98844982/32/6_449c533f586939b6e5f246632a46421f.png) [@anon98844982](https://forum.infinityfree.com/u/anon98844982)\
**Post date:** [October 10, 2022, 11:06pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/3 "2022-10-10T23:06:58Z")

</div>

Yea

```auto
<?php 

session_start();

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require_once("settings.php");
require_once("definitions.php");
require_once("components/tools.php");
require_once("components/shortcuts.php");
require_once("components/compilers.php");
require_once("components/localization.php");
require_once("components/glob_context.php");
require_once("components/user.php");
require_once("components/post.php");
require_once("components/ad.php");
require_once("configs/conf.php");
require_once("libs/DB/vendor/autoload.php");

$cl["db_errors"] = array();
$sql_db_host = (isset($sql_db_host) ? $sql_db_host : "");
$sql_db_user = (isset($sql_db_user) ? $sql_db_user : "");
$sql_db_pass = (isset($sql_db_pass) ? $sql_db_pass : "");
$sql_db_name = (isset($sql_db_name) ? $sql_db_name : "");
$site_url = (isset($site_url) ? $site_url : "");
$mysqli = new mysqli($sql_db_host, $sql_db_user, $sql_db_pass, $sql_db_name);

if (mysqli_connect_errno()) {
    array_push($cl["db_errors"], mysqli_connect_error());

    if (not_empty($cl["db_errors"])) {
        echo cl_html_template("db_errors");
        die();
    }
}

$me = array();
$db_connection = $mysqli;
$query = $mysqli->query("SET NAMES utf8");
$set_charset = $mysqli->set_charset('utf8mb4');
$set_charset = $mysqli->query("SET collation_connection = utf8mb4_unicode_ci");
$db = new MysqliDb($mysqli);
$url = $site_url;
$config = cl_get_configurations();
$config["url"] = $url;
$config["theme_url"] = cl_strf("%s/themes/%s",$url,$config["theme"]);
$config["site_logo"] = cl_strf("%s/%s",$config["theme_url"],$config["site_logo"]);
$config["site_fav"] = cl_strf("%s/%s",$config["theme_url"],$config["site_favicon"]);
$cl["is_logged"] = false;
$cl["is_admin"] = false;
$cl["config"] = $config;
$cl["server_mode"] = "prod"; 
$cl['csrf_token'] = cl_generate_csrf_token(); 
$cl['ref_url'] = http_referer();
$cl['auth_status'] = cl_is_logged();
$cl["languages"] = cl_get_ui_langs();
$cl["display_set"] = array(
    "color_scheme" => $cl["config"]["default_color_scheme"],
    "background" => $cl["config"]["default_bg_color"]
);

$cl["curr_lang"] = array(
    "lang_data" => array(
        "id" => "0",
        "name" => "Default",
        "slug" => "default",
        "status" => "1",
        "is_rtl" => "N"
    ),
    "lang_text" => cl_get_langs("default")
);

if (isset($_COOKIE["lang"])) {
    if (isset($cl["languages"][$_COOKIE["lang"]])) {
        $cl["curr_lang"] = array(
            "lang_data" => $cl["languages"][$_COOKIE["lang"]],
            "lang_text" => cl_get_langs($_COOKIE["lang"])
        );
    }
}
else if(isset($cl["languages"][$config["language"]])) {
    $cl["curr_lang"] = array(
        "lang_data" => $cl["languages"][$config["language"]],
        "lang_text" => cl_get_langs($config["language"])
    );
}

if (not_empty($cl['auth_status']['auth'])) {
    $cl['hash_session'] = $cl['auth_status']['token'];
    $user_data_ = cl_user_data($cl['auth_status']['id']);
    $me = $cl['me'] = ((empty($user_data_)) ? false : $user_data_);

    if (not_empty($me)) {
        if (isset($cl["languages"][$me['language']])) {
            $cl["curr_lang"] = array(
                "lang_data" => $cl["languages"][$me['language']],
                "lang_text" => cl_get_langs($me['language'])
            );
        }
        
        $cl['is_logged'] = true;
        $me['draft_post'] = array();
        $me['new_notifs'] = cl_total_new_notifs();
        $me['new_messages'] = cl_total_new_messages();
        $me['new_notifs'] = ((is_posnum($me['new_notifs'])) ? $me['new_notifs'] : '');
        $me['new_messages'] = ((is_posnum($me['new_messages'])) ? $me['new_messages'] : '');
        $cl["is_admin"] = (($me['admin'] == '1') ? true : false);
        $cl["display_set"] = json($me["display_settings"]);
        
        if (is_posnum($me['last_post'])) {
            $me['draft_post'] = cl_get_orphan_post($me['last_post']);

            if (empty($me['draft_post'])) {
                cl_delete_orphan_posts($me['id']);
                cl_update_user_data($me['id'],array(
                    'last_post' => 0
                ));
            }
        }

        if ($me['last_active'] < (time() - (60 * 30))) {
            cl_update_user_data($me['id'], array(
                'last_active' => time(),
                'ip_address' => cl_get_ip()
            ));
        }
    }
}

else {
    if ($cl['config']['affiliates_system'] == 'on') {
        if (not_empty($_GET['ref'])) {
            $ref_uname = cl_text_secure($_GET['ref']);
            $ref_udata = cl_get_user_by_name($ref_uname);

            if (not_empty($ref_udata)) {
                cl_session('ref_id', $ref_udata['id']);
            }
        }
    }
}

if (not_empty($_GET['language'])) {
    $lang_name = cl_text_secure($_GET['language']);

    if (isset($cl["languages"][$lang_name])) {
        setcookie("lang", $lang_name, strtotime("+1 year"), '/') or die('unable to create cookie');

        if (not_empty($cl["is_logged"])) {
            $set_lang = cl_update_user_data($me['id'], array('language' => $lang_name));
            $ref_url = http_referer();

            if ($cl['ref_url']) {
                cl_location($cl['ref_url']);
            }
            else {
                cl_redirect_after('/', 0.05);
            }
        }
    }
}

if (not_empty($cl["config"]["google_ad_horiz"])) {
    $cl["gads_horiz"] = htmlspecialchars_decode($cl["config"]["google_ad_horiz"]);
}

if (not_empty($cl["config"]["google_ad_vert"])) {
    $cl["gads_vert"] = htmlspecialchars_decode($cl["config"]["google_ad_vert"]);
}

```

---

<div class="post-metadata">

**Author:** ![anon98844982](https://forum.infinityfree.com/letter_avatar/anon98844982/32/6_449c533f586939b6e5f246632a46421f.png) [@anon98844982](https://forum.infinityfree.com/u/anon98844982)\
**Post date:** [October 10, 2022, 11:11pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/4 "2022-10-10T23:11:19Z")

</div>

what can i do to fix this error? 😔

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [October 17, 2022, 5:25pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/6 "2022-10-17T17:25:45Z")

</div>

As you can see in this topic, the “No such file or directory” error means you are using `localhost` as the database hostname, instead of the actual value. This is also the default value you may see if you don’t provide any MySQL hostname to the connection.

> [@Common MySQL Connection Errors](https://forum.infinityfree.com/t/common-mysql-connection-errors/49338):
>
> Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some general tips to keep in mind when setting up a database connection. Common Error Messages Using MySQL is great, but the error message returned if there is an issue logging in to your database can be quite confusing. Here are some commonly seen error…

Can you please debug the code to check that all the `$sql_db_???` variables are filled correctly? Your code sets them all to an empty string, but looking at the code they may be defined elsewhere. Please check and make sure that’s actually the case.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 24, 2022, 5:26pm UTC](https://forum.infinityfree.com/t/warning-mysqli-construct-hy000-2002-no-such-file-or-directory-in-home-vol1000-5-epizy-com/67106/7 "2022-10-24T17:26:16Z")

</div>

Closed on October 24, 2022, 5:26pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
