Answer the question
In order to leave comments, you need to log in
Why instead of mysqli_connect and PDO error 504 Gateway Time-out (nginx fpm php 7.3)?
I'm trying to connect to an external server on another hosting. Everything works locally.
Tried:
$con = mysqli_connect($db_hostname, $db_username, $db_password, $db_name);
if (mysqli_connect_errno()) {
echo mysqli_connect_error();
}
try
{
$db = new PDO("mysql:host=$db_hostname;dbname=$db_name", $db_username, $db_password);
return 'ok';
}
catch (PDOException $e)
{
echo $e->getMessage();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question