Hello folks,
I pulled latest HTTPD, PHP, MYSQL. Now I want to make everything working together.
I created apache with php using this
docker run -d -p 8080:80 --mount type=bind,source="my_local_folder",target=/var/www/html php:apache
This works perfectly. Now I created a MySQL DB. Using Docker Adminer, I can connect to that DB. That is OK.
But when I’m trying to connect via PHP function mysqli
$mysqli = mysqli_connect($server, $user, $pass, $db);
Server is the container name of MySQL Docker, user is root, pass is my pass and DB is the name for my DB. Where I’m making the mistake?
**Warning** : mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in **/var/www/html/temp_log.php** on line **8**
**Warning** : mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in **/var/www/html/temp_log.php** on line **8**
Error: Unable to connect to MySQL. Debugging errno: 2002 Debugging error: php_network_getaddresses: getaddrinfo failed: Name or service not known
Thanks a lot!