1
I just created a domain on Ocaweb and created a website and database.
When accessing the site, it loads part of the page, but I have the following error:
SQLSTATE[HY000] [2002] Can’t connect to local Mysql server through socket '/var/lib/mysql/mysql.Sock' (2) Fatal error: Call to a Member Function query() on a non-object in /home/Storage/9/04/78/gabrieldevito/public_html/gentelella-master/Production/Classes/Persistencia/Contacrud.php on line 44
The connection class with the bank is:
class Connection {
public $host = 'localhost';
public $dbname = 'usodecontas';
public $username = 'root';
public $password = 'abc123';
public function conectar() {
try {
$conn = new PDO("mysql:host={$this->host};dbname={$this->dbname}", $this->username, $this->password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $conn;
} catch (PDOException $e) {
echo $e->getMessage();
}
}
}
Guys, Ocaweb support is terrible and I’m not finding any tutorial to help me make a remote connection to the server so I can apply some commands that exist on other topics. Has anyone experienced similar problems?
Thank you.
Probably a lot of people have been through similar problems. It was just me leaving for Amazon that the problems are over (it’s not spam, I’m not affiliated with Amazon in any way, just a customer). The funniest thing: THREE MONTHS after I shut down the LW server, having already deleted everything I could before the removal, I received an email warning that the server was out of air kkkk. And about 8 months later, I received an invitation by email with a link to an event of theirs, and... the link didn’t work :) ! probably because my account was no longer found there. A beauty the integration of things.
– Bacco