pdo_mysql error suddenly appears on drupal based website?
Asked Answered
E

3

9

My drupal based website was working fine till yesterday but suddenly from no where today an error appeared

Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /.../includes/database/mysql/database.inc on line 43

I didn't even changed or updated anything since yesterday, it suddenly appears from no where, before that it was working fine

On line 43 of database.inc this was written

 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,

I googled and got some idea that this is some sort of PDO_MYSQL error, i have not much idea why this error suddenly arrived

Can anyone please help me out

Additional information

  • Linux Shared Webhosting
  • DRUPAL 7
  • Apache version 2.2.20
  • PHP version 5.2.17
  • MySQL version 5.0.92-community-log
  • cPanel Version 11.30.3 (build 5)
Endermic answered 23/9, 2011 at 11:43 Comment(3)
Maybe ask the hosting provider whether they changed anything in the configuration?Photogram
web hosting company replied me there is some problem with your script, i but didn't changed anythingEndermic
Did your webhost deactivate PDO? Create a php file wich contains the code <?php phpinfo();?>, it will display all your php config. Check if PDO is mentionned or not.Motif
A
7

According to a lot of different sources the pdo_mysql extension must be missing from your PHP installation. Either add it in php.ini or ask your hosting provider to do it for you.

Links:

They all say the same thing...install the pdo_mysql extension. Sounds like your hosting provider has disabled it!

Atlantis answered 23/9, 2011 at 12:46 Comment(1)
Thanks. I've checked pdo_mysql is missing, i'm asking my web host for itEndermic
T
1

This can also be due to a permissions issue. Sometimes, given the use of SuPHP or other configurations in which the apache (or other server) user can't run a file, you'll get this sort of error and PDO_MYSQL: will already be installed and operational.

If you have root access to the box, try doing a

sudo php /path/to/your/php/script.php

or recursively chown the directory to the appropriate apache user (usually apache or www-data) or the user who's home directory your files are resting in (the case in most shared servers).

chown -R apache:apache /path/to/web/files
Toombs answered 9/2, 2013 at 20:56 Comment(0)
W
-1

I had exactly the same problem. My site suddenly went down. I started looking at installing php extension php_pdo_mysql.dll from cPanel PHP PEAR as suggested above, but this failed. I started a live chat with my host (Justhost) and it tuned out they had upgraded their php version. They fixed it in 2 minues.

Wales answered 25/11, 2015 at 0:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.