Skip to content
Advertisement

PHP 7.1 on Docker PDO Driver not installed – Verified it is on the image

I am always getting an error that PDO driver not found. I tried restarting, installing PDO extensions directly. Note that this docker setup works on my Linux box last night. Only difference is I did it from scratch compared to on my Windows box I already has images.

After getting the error initially I tried to remove the images, the base PHP image failed to remove for some reason. I then ran:

  1. docker exec -it php sh
  2. docker-php-ext-install pdo pdo_mysql

Running that command explains that the extensions were already installed. But I still receive the error.

I also noticed this is present along with the modules:

JavaScript

DockerFile PHP

JavaScript

PHP Modules on Docker Container

JavaScript

SysInfo

  • Windows 10 Pro
  • Docker version 17.06.0-ce, build 02c1d87

Advertisement

Answer

I did use to see the already installed message when I ran docker build but it still built the image fine for me.

https://github.com/fire015/docker/blob/master/php-fpm-71/Dockerfile

Try building it from fresh using docker build --no-cache=true

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