-2

I am facing a problem with an application that i am testing. It is been hosted for a matter of test and the DB CRUD works fine in the comon part of the system, but when the user tries to be redirected to its dashboard, he receives the follows message before the dashboard section is loaded:

Database connection failed badlyphp_network_getaddresses: getaddrinfo failed: Name or service not known

I have 3 files in my DB that have conection to the DB. I did this because it has a complexity in the system and it comes from an old system that i made work better. I works all fine locally but when on the hosting it displayes my this message. Any sugestions on what could be the issue? Thank you!

Luiz Wynne
  • 460
  • 3
  • 10
  • 28
  • Please post the code that you are using to connect to your database. We can't really help you without it. – rpm192 Apr 22 '18 at 14:39

1 Answers1

0

This error is basically saying the host cant be found. Are you using 'localhost' as the ip to connect to the database. If not check the ip of the database that you should be connecting with.

Joosh
  • 136
  • 1
  • 9
  • Yes, im using localhost on all the connections. Any idea on what might be happening? – Luiz Wynne Apr 22 '18 at 11:03
  • Check if your host has an external database host you need to connect to. I know this is the case with OVH web hosting so if using localhost where the host does this will throw that error. – Joosh Apr 22 '18 at 11:11
  • Still couldnt solve this problem. i tried using the DB_HOST constant as localhost, 127.0.0.1 and the ip address of the server. None of them work. Any idea on what is going on? – Luiz Wynne Apr 23 '18 at 19:30
  • Your not understanding what im suggesting, check with your host that the database is not hosted externally as you owuld need an entirely different ip for that. – Joosh Apr 25 '18 at 20:29