I get the above error while trying to install Drupal 7.

My host has PHP 5.2.5 installed, with PDO support.

phpinfo gives configure command as including '--enable-pdo=shared', '--with-pdo-mysql=shared', '--with-pdo-sqlite=shared'.

Can anyone help?

Thanks,

Mike.

Comments

pixor’s picture

Apologies to everyone - the answer was here but I didn't look hard enough :p

PDO support had been compiled in, but not enabled .

Adding

extension=pdo.so
extension=pdo_mysql.so

to my php.ini solved the problem.

csc4’s picture

I had a problem with this too.

On Windows the addition needs to be

extension=pdo.dll
extension=pdo_mysql.dll

(or extension=pdo_mssql.dll is using MSSQL)

I was wondering if adding this to the install file would be a good idea?

Warren-M’s picture

Thanks for the answer.

BTW where did you have to look to find it?

Warren

extensive’s picture

This code is working for me.

DanWoodbury’s picture

I have tried all of the above and restarted the appache server each time but still no joy

any ideas?

thanks

dgale’s picture

Make sure that you included PDO when you installed PHP. If not, modify the install and add them in.
And for me, the above entries were not correct. After changing my PHP install, the following extensions were automatically added to my php.ini:

[PHP_PDO]
extension=php_pdo.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll

drupalnode’s picture

Thanks this solved my issue

jasonesser’s picture

I have a D6.24 multi-site install running perfectly on a Site5 server with modified php.ini. I have also installed D7.12 on a subdomain to begin development of an upgraded site.

I have the lines added to php.ini to enable PDO;

extension=pdo.so 
extension=pdo_sqlite.so 
extension=sqlite.so 
extension=pdo_mysql.so

however after uploading a modified php.ini to increase php_memory limit, I get the Fatal error: Class 'PDO' not found in... WSOD.

removing the php.ini from the subdomain folder allows the site to operate, however at a memory_limit of 64M. Not what I need as I keep getting WSOD errors for being over the memory limit when manipulating my calendar views...

jasonesser’s picture

I modified my php_memory limit through my settings.php. Hopefully everything else will work...

d_f’s picture

Thanks a lot for the information, it solved the problem for me. Therefore, I just wanted to drop by and say thanks.

sunil-kumar’s picture

when i remove php.ini file from my sub domain, error not occur, and my site work properly...

thank you..

svabhishek’s picture

Great news .. I had the error and adding those lines clearly worked :)

The php.ini file dint exist .. I really dont know why but I created one in my installation root ( ie /var/ww or your public_html folder ) and added those lines :) Totally works :)

MohammadMoussa-Lebanon’s picture

thank you it worked with me too

zeta1600’s picture

We recently upgraded to a newer release of MySql. And we recieved the error: "Fatal error: Class 'PDO' not found in ..."

Here's what we did and found. We are hosted on a whm/cpanel.
WHM 11.34.1
Apache 2.2.23
PHP 5.3.21

We went to EasyApache to rebuild the profile. In the Exhaustive Options List, and PDO and PDO MySQL was not ticked, so we selected both. Went through the rebuild.

Then, we found out that in Home » Service Configuration » PHP Configuration Editor » Advanced
Core | extension, the text was written this way:
timezonedb.so, pdf.soextension=pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so, pdo.so

I edited it to add a comma and space after pdf.so, like so:
timezonedb.so, pdf.so, extension=pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so, pdo.so

I hope that this helps someone...

psililisp’s picture

I love you for your post.

I just started a new website on a VPS (2013-02-18) and checking the "PDO" boxes via the "Easy Apache" configuration settings in the "Exhaustive Options" setting made the error go away. I've never had to do such settings configuration on a VPS for Drupal, but now I know additional configuration settings to look out for when setting up new hosting.

Thank you zeta1600.

TimeBandit’s picture

thanks, this worked for me as well.

mdavid01’s picture

In my case, using Go-Daddy, this was all the sudden. The app had been working. I hadn't accessed the site in several days. GoDaddy support found there was process running that had to be killed. So, I your app has been working and you get this message, restart apache or look for php processes that should be killed.

ranelpadon’s picture

In my case (in GoDaddy hosting), the error will be gone when I rename/delete the local php.ini (the ini file in the user's home directory), but since I need to override some PHP configurations, I traced the global/default ini file loaded using the phpinfo() in a test PHP file. Then, I copied the contents of that file in my local ini and it worked (the error will be gone). After that, I modified further the other settings in the copied PHP file (like adjusting memory limit, max upload size, etc).

kaitangroup1’s picture

In my case the problem was extension_dir. I had the error log as PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226 . I had fixed it by changing the extension_dir from php.ini

kgamone’s picture

Can anyone please help me how to solve error here .. it says 'PDO' not not found in database line 18 ...

but this only came after i uploaded my files to cpanel.