Connection failed: No such file or directory ~ ERROR while loggin and regiter

http://hellouserapp.epizy.com

Error:
Connection failed: No such file or directory

my DB file snippet:

class Dbh{
    //mySqli  objject oriented approach
    private $servername; 
    private $username;
    private $password;
    private $dbname; 

    public function connect() {
        $this->servename = "sql203.epizy.com";
        $this->username = "epiz_26108976"; 
        $this->password = "xxx";  //here I entered my vpanel pwd
        $this->dbname = "epiz_26108976_hellouser";

        // Create connection
        $conn = new mysqli($this->servername, $this->username, $this->password, $this->dbname);

        
        // Check connection
        if ($conn->connect_error) {
             die("Connection failed: " . $conn->connect_error);
         }
         else{
             return $conn;
         }
    }
}

Looks like you have a typo.

8 Likes

thanks brother it was great help, I always do such typos and but this one was a tough one, thanks for your time and solution!

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