I'm trying to set up my docker with php app (Symfony 3).
Everything seems to be fine but, Symfony can't connect to mysql.
I have the error:
Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred in driver: could not find driver"
My docker-compose.yaml file is:
version: '3'
services:
app:
image: car-rental
ports:
- "8888:80"
links:
- php
- db
volumes:
- ./.code:/var/www/html
depends_on:
- db
php:
image: php:7.1-fpm
volumes:
- ./.code:/var/www/html
db:
image: mysql:5.7
volumes:
- mysql-data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: rental
volumes:
mysql-data: