Hey, I'm trying to create a pipeline for a Laravel 5.6 project, and I am failing miserably.
The issue I get is:
php artisan migrate
In Connection.php line 664:
could not find driver (SQL: select * from information_schema.tables where t
able_schema = Test and table_name = migrations)
In Connector.php line 67:
could not find driver
and my bitbucket-pipelines.yml is:
image: php:7-fpm
pipelines:
default:
- step:
deployment: test
script:
- apt-get update && apt-get install -qy git curl libmcrypt-dev mysql-client zip unzip
- docker-php-ext-install mcrypt && docker-php-ext-install pdo_mysql
- ./install-composer.sh
- composer install
- export CACHE_DRIVER=redis
- export SESSION_DRIVER=redis
- export DB_CONNECTION=mysql
- php artisan migrate
- php artisan serve &
- sleep 5
- curl -vk http://localhost:8000
services:
- mysql
definitions:
services:
mysql:
image: mysql
environment:
MYSQL_DATABASE: "Test"
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_USER: "Test"
MYSQL_PASSWORD: 'Test'
I do not know why this happens, this is my first time creating a pipeline. Any thoughts?
- export DB_CONNECTION=mysql
should be
- export DB_CONNECTION=pdo_mysql
Hi George,
Looking here (https://stackoverflow.com/questions/22463614/php-artisan-migrate-throwing-pdo-exception-could-not-find-driver-using-larav) it seems you may also need to install php-mysql into your container with apt (I'm not sure on how docker-php-ext-install interacts in this context)
Try adding
apt-get install php-mysql
to your script and see if that helps?
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
bump. anyone?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.