Skip to content
Advertisement

Docker-Composte LEMP : Error: could not find driver

I am trying to create a LEMP in Linux with docker-compose, I have managed to get PHP, NGINX and MySQL to work for me but when connecting to the DB from a php file it returns the exception: could not find driver

This is my docker-compose.yml file

JavaScript

This is my DockerFile

JavaScript

This is the PHP file that connects to the DB

JavaScript

Advertisement

Answer

I have managed to solve it, I have added the Dockerfile file that @β.εηοιτ.βε and it gave me another error so I have done it all again and it has worked for me:

Folder Structure:

JavaScript

Nginx config:

JavaScript

docker-compose.yml config

JavaScript

Dockerfile config:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement