I faced this issue, while connecting DB, the variable to connect to db was not defined.
Cause: php tried to connect to the db with undefined variable for db host (localhost/127.0.0.1/... any other ip or domain) but failed to trace the domain.
Solution: Make sure the db host is properly defined.