1

I'm french, so excuse me if my english is sometimes weird.

I'm trying to learn how to use symfony and I'm stuck on the very beggining since 3 days now. When I try to use doctrine i have this error :

In AbstractMySQLDriver.php line 115: An exception occured in driver: could not find driver

I saw a lot of posts about this problem but none of them has resolved the problem.

For information :

  • I'm using wamp on windows 10
  • PDO_mysql is activated as it's written in the info.php file : PDO drivers mysql, sqlite
  • PDO_mysql is activated on wamp
  • I tried with xamp, i have the same problem
  • I have php 7.2.4

here is my parameters.yml file :

parameters:
database_host: 127.0.0.1
database_port: null
database_name: betagame
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: ThisTokenIsNotSoSecretChangeIt

the driver specified is PDO_mysql and I'm using the 3.4.8 version of symfony ! Thank you for your reply ! I have also tried to replace pdo_mysql by PDO_pgsql and i activated it on wamp but i recieved the same error

what is activated on my php running in command lines :
PS D:\wamp\www\symfony> php -m
[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

thank you for your help !

Phil
  • 157,677
  • 23
  • 242
  • 245
  • What does your `app/config/config.yml` file look like? What `driver` is specified? – Phil Apr 23 '18 at 23:48
  • Also, what version of Symfony are you using? – Phil Apr 23 '18 at 23:50
  • What are you doing to trigger this error? Is it from running a command line program or are you seeing it in your browser? – Phil Apr 23 '18 at 23:58
  • It s when im running this command : php bin/console doctrine:database:create – julien mantovani Apr 24 '18 at 00:05
  • Chances are your command line PHP uses a different `php.ini` file which does not have the `pdo_mysql` driver enabled. See https://stackoverflow.com/q/3057110/283366 – Phil Apr 24 '18 at 00:43
  • In the php version used in command lines i have that : PS D:\wamp\www\symfony> php -m [PHP Modules] bcmath calendar Core ctype date dom filter hash iconv json libxml mbstring mysqlnd openssl pcre PDO Phar readline Reflection session SimpleXML SPL standard tokenizer wddx xml xmlreader xmlwriter zip zlib – julien mantovani Apr 24 '18 at 00:50
  • 1
    Seems it's missing `pdo_mysql` – Phil Apr 24 '18 at 00:52
  • I will try to understand how to do and i come back when i get it ! – julien mantovani Apr 24 '18 at 00:54
  • It's usually just a case of uncommenting the `extension pdo_mysql.dll` line (or adding it if it's not present). You should be able to compare it to the `php.ini` file used by your web server – Phil Apr 24 '18 at 00:55
  • It works ! Agreat thank you ! I can now go forward ! – julien mantovani Apr 24 '18 at 01:36
  • You're welcome. Good luck with the rest of the project :) – Phil Apr 24 '18 at 01:40
  • Thank you ! I dont know if there is a button "resolved" i can't see it – julien mantovani Apr 24 '18 at 01:44
  • I found a similar question and have closed this as a duplicate. Please don't remove your question though as it has a lot of good information that may help others with the same problem find an answer. – Phil Apr 24 '18 at 01:46

0 Answers0