My application's tests are run on circleci for pull requests. The 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
  - run:
      name: Install mysql php
      command: sudo apt-get install php7.1-fpm

  - 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. That particular command says unable to locate package.

0 Answers