Php_network_getaddresses: getaddrinfo for sql108.infinityfree.com failed: Name or service not known

I’m actually setup my Symfony project environment. This is the database setup on .env according to my database info on infinityfree dashboard:
DATABASE_URL=“mysql://if0_35441318:*******@sql108.infinityfree.com/if0_35441318_laoka_anio?serverVersion=8&charset=utf8mb4”

But when I test the database connection with this command “bin/console doctrine:query:sql ‘SELECT 1’”, it shows the error “An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for sql108.infinityfree.com failed: Name or service not known”

NB: I’m working on Github codespace
Thanks

External connections are not supported on free hosting:

7 Likes

Thanks. So it would work very well in production?

Unless there is an error with your code, then yes. You won’t know until you try!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.