I have the following docker.yml file
version: "3"
services:
wwww:
build: .
ports:
- "8888:80"
volumes:
- "./src:/var/www/html/"
networks:
- default
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
adminer:
image: adminer
restart: always
ports:
- 8060:8080
and the docker file for php is
FROM php:7.2-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
I checked with phpinfo()
and the pdo driver is enabled for sqlite.
Even when I do docker-compose I get the following warning
warning: pdo (pdo.so) is already loaded!
However, I still get an exception that pdo is not found.
Is there anything that I am missing ?
The exact error is
Fatal error: Uncaught PDOException: could not find driver in /var/www/html/index.php:5
Stack trace:
#0 /var/www/html/index.php(5): PDO->__construct('mysql:host=127....', 'root', 'example')
#1 {main} thrown in /var/www/html/index.php on line 5