SQLSTATE[08006] [7] could not translate host name "pgsql" to address: Name or service not known

Joined
Feb 4, 2024
Messages
1
Reaction score
0
I am writing a chat bot in php using Telegraph. Since weghook telegram requires https connection I use ngrok. There is a problem when I use the postgres image I get the error 'host name "pgsql" to address: Name or service not known' in the env file host name postgres specified container name pgsql. But at the same time web hook telegram work. When changing the host name in the env file to localhost the telegram hooks do not work. How can fix it?

postgres section from .evn file

DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=telegram_bot
DB_USERNAME=sail
DB_PASSWORD=password
I tried changing DB_HOST=localhost, but webhook stops working
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top