Unable to connect from php to mysql db

Hello,
When I’m trying to connect to db, I got that error: "Unable to connect: No such file or directory "
That’s my php code:
$mysqli = new mysqli($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASS, $MYSQL_DB);
if ($mysqli->connect_errno) {
printf("Unable to connect: %s
", $mysqli->connect_error);
exit();
}
host, user, pass and db is from “MySql Databases” located in cpanel.
How to resolve that issue?

The error implies your database hostname is incorrect. Does $MYSQL_HOST have the correct value?

MySQL hostname: sql204.rf.gd
The host name is from cpanel.

I just checked the common.php file of your script and I saw the following line:

$MYSQL_HOST = "localhost";

Please change that to the correct MySQL hostname.

It was made for testing.
Just change $MYSQL_HOST to “sql204.rf.gd”
Same error.

The opening tag in common.php was incomplete (it was <php) so the file was not actually parsed. It works now.

Thanks!
Now everyting is working!

PS. BTW - your hosting is great, thanks!