简体   繁体   中英

PDO driver exception symfony2

im on ubuntu12.10 using xampp 1.8.1

i was working on a symfony2 project on a windows machine and im currently working on same project from ubuntu machine.

the problem is when i run commands like

php app/console doctrine:schema:update

it gives error

PDO exception:could not find driver

whereas i checked my phpinfo and pdo_mysql is enabled.also there are many select and insert queries in my project which are working fine.

also when i run php -m it shows only PDO and not pdo_mysql

is something wrong with the enviornment variable or something like that?

Its possible that the pdo_mysql extension is not enabled in your php CLI ini file.

Check your ini file for the pdo_mysql extension, you can get your ini file location from php --ini . On ubuntu it should output a list of all loaded ini files, look for

/etc/php5/cli/conf.d/pdo_mysql.ini

and

/etc/php5/cli/conf.d/pdo.ini

If either of these two ini files are not listed, then you haven't installed that extension. If they are present, then make sure they extension is enabled inside those ini files.

Make sure you enable the extensions php_pdo_mysql and php_pdo on php.ini file that your symfony project is using, check this on localhost/path_to_your_project/web/config.php

Tip: check out you Apache error log , there could be something wrong with the load of your extensions. This file is located according to your server configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM