How can I check whether database host is valid?
try {
Yii::app()->db;
} catch (Exception $ex) {
echo $ex->getMessage();
}
Code above gives me this error when I use invalid host address:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: No such host is known.
I just want to receive something that returns false, so I could display my own error message
mysql_ping
? – jycr753 16 hours ago