Php artisan clear-compiled PDOException could not find driver


My pull request tests are failing during my composer install command. It fails once it gets to php artisan clear-compiled, which is run once composer install completes.

version: 2
- image: circleci/php:7.1-fpm

working_directory: ~/repo

  - checkout

  # php ini settings
  - run:
      name: Configure Timezone
      command: echo -e "[Date]\ndate.timezone = America/Detroit" | sudo tee /usr/local/etc/php/php.ini > /dev/null
  - run:
      name: Configure Memory Limit
      command: echo -e "memory_limit = 512M" | sudo tee /usr/local/etc/php/php.ini > /dev/null

  - restore_cache:
      - v1-dependencies-{{ checksum "composer.json" }}
      - v1-dependencies-

  - run: composer install

  - save_cache:
        - ./vendor
      key: v1-dependencies-{{ checksum "composer.json" }}

  - run: sh tests/unit/

The error is PDOException could not find driver. I’m not sure if there is a better image to choose, but I have also tried to add a few different commands to install php mysql, but those haven’t been working. For example, the latest command I tried was sudo apt-get install php7.1-fpm


Hey @djones8520, are you able to fix this issue ?

Appreciate if you can suggest anything ?


Unfortunately not yet. I posted this question on stackoverflow as well and they suggested to run sudo apt-cache search php | grep mysql. After figuring out how to enable ssh, I got no results.

I tried quite a few different install commands with no luck (and a few different images).


What do you get from php -m in an SSH session?