Cannot build Symfony 3 app + database using bitbucket pipeline Edited

Hi all,


I'm working on a prototype using Symfony 3.
I'm not able to run tests through the pipelines service because I receive following errors. It seems the parameters.yml file that is generated in the yml file is not read.


[Doctrine\DBAL\Exception\DriverException]  An exception occurred in driver: could not find driver

[Doctrine\DBAL\Driver\PDOException] could not find driver

[PDOException] could not find driver

Can someone help me, please?


# This is a sample build configuration for PHP.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.11

- step:
- apt-get update && apt-get install -y unzip
- curl -sS | php -- --install-dir=/usr/local/bin --filename=composer
- composer -V
- composer install
- cp app/config/parameters.yml.dist app/config/parameters.yml
- "sed -i 's/database_port: ~/database_port: 3306/' app/config/parameters.yml"
- "sed -i 's/database_name: symfony/database_name: pipelines/' app/config/parameters.yml"
- "sed -i 's/database_user: root/database_user: test_user/' app/config/parameters.yml"
- "sed -i 's/database_password: ~/database_password: test_user_password/' app/config/parameters.yml"
- composer test
- mysql

image: mysql
MYSQL_DATABASE: 'pipelines'
MYSQL_USER: 'test_user'
MYSQL_PASSWORD: 'test_user_password'




1 comment

You need to install pdo_mysql in the docker image. This is very simple:

  • Add mysql-client to you apt-get install section. The first command in your script section should be changed to
    - apt-get update && apt-get install -y unzip mysql-client
  • Add a new command after apt-get install:
    - docker-php-ext-install pdo pdo_mysql

After this two steps pdo_mysql is available in your image.


Log in or Join to comment
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,320 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot