PDOException "Driver not found" in php
P粉478445671
P粉478445671 2023-08-29 14:04:38
0
2
624
<p>I have installed Lampp on my linux system and I am learning symfony2 while trying to create schema using symfony2 command</p> <pre class="brush:php;toolbar:false;">php app/console doctrine:schema:create</pre> <p>I received the following error message: -</p> <pre class="brush:php;toolbar:false;">PDOException “could not find driver”</pre> <p>I also uncommented the line <code>extension=php_pdo_mysql.dll</code></p> in the php.ini file <p>I tried finding and searching for my problem but I couldn't solve my problem. When I run the <code>php -m</code> command I get the following result: -</p> <pre class="brush:php;toolbar:false;">PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626 lfs/mysql.so' - /usr/lib/php5 /20090626 lfs/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626 lfs/mysqli.so' - /usr/lib/php5/20090626 lfs/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626 lfs/pdo_mysql.so' - /usr/lib/php5/20090626 lfs/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 [PHP Modules] bcmath bz2 calendar Core ctype date dba dom ereg exif fileinfo filter ftp gettext hash iconv json libxml mbstring mhash openssl pcntl pcre PDO ---- ----</pre> <p>Is there any way to eliminate this problem? </p>
P粉478445671
P粉478445671

reply all(2)
P粉788571316

In Ubuntu, write

in the console
sudo apt-get install php5-gd php5-mysql

It will work

P粉203792468

Hopefully you are running your project in localhost. There is a file named parameters.ini in your project folder app/config, make sure your Mysql database connection is configured correctly. If you use mysql, see database_driver=pdo_mysql is the driver for it.

Below is an example.

database_driver   = pdo_mysql
    database_host     = localhost
    database_port     =
    database_name     = databasename
    database_user     = msqlusername
    database_password = mysqlpassword//if not make blank

    mailer_transport  = smtp
    mailer_host       = localhost
    mailer_user       =
    mailer_password   =

    locale            = en

    secret            = ThisTokenIsNotSoSecretChangeIt

hope it helps you.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template