Reputation: 359
My symfony project do not find pdo_mysql driver. I am using debian server. The same config works on OSX ok but not here. When I use php -m command it show driver and also the php -i |grep pdo_mysql show:
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
API Extensions => mysqli,pdo_mysql
pdo_mysql
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
This is my symfony configuration and paramters:
parameters:
database_host: 127.0.0.1
database_port: 3306
database_name: bisol_time
database_user: root
database_password: root
Config:
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
So what can i do. I try everything and read every topic under this problem but i do not find the solution. Can anyone help me?
Upvotes: 1
Views: 4796
Reputation: 7764
I believe there is a different pdo for PHP 5.
On my system (CentOS 6) I have php70u-pdo.i686
. I checked by using yum list installed |grep pdo
. I can't guide you to install on OSX, I suspect you need to use brew
, but check to see if you can install pdo for PHP7 and enable it in your php.ini file.
That sounds like the problem.
EDIT # 2 Based on Comments
Can you try:
apt-get install php7.0 php7.0-mysql
I think the mysql installs pdo as well. Try it. not sure if it will work.
Upvotes: 1
Reputation: 2698
This is not related to the Symfony but for the system setup.
As you can see when you run PHP in CLI it uses the config from /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
(notice the cli in the path). While when used by Apache it uses most likely /etc/php/7.0/apache2/conf.d/20-pdo_mysql.ini
or similar.
You can either nevigate to /etc/php/7.0/
or create info.php
with <?php phpinfo();
and see where the config files are.
It seems that in that PHP configuration for apache the driver is not installed.
Upvotes: 1