I have tried many times installing Drupal with different php version .2 .3 and .4 without success. each time I get this error and when I checked the file in question (database.ini) I couldn't find any problem with it (line 184 is correct).
The error is:
Fatal error: Class 'PDO' not found in database.inc on line 187
is your PDO driver is correct for all php version? and how can I update this PDO driver?
Thank you for your question today. This error is usually due to the php.ini file not having the pdo settings enabled. You will want to have this set within the php.ini file in your hosting account file structure. Make sure you add the following lines to your php.ini file.
Thanks for the reply.
That's the first thing I have checked when I encountered this proble and all those lines were there.
Many posts out there suggest that the real problem is the hosting provider not binding the correct PDO driver for apecific php version.
The webhostinghub support staff don't seem to help on this and they blame it all on Drupal. However, I have many and many of my colleagues have thier Drupal sites install with other hosting provider without any problems and I me I am stack on the first hurdle..
any other suggestions...otherwise I'll have to change my hosting...
Thanks for your time
As per Scott, the main issue is that the reference for PDO is stored within the PHP.INI file. I looked at your website and you didn't have a PHP.INI file in that website, but the overall hosting account has a main PHP.INI in the public_html folder that is referenced. When typed in your domain name /phpinfo.php, you can see that the PDO drivers are loading. I went ahead and updated the PHP.INI file, so it should be working with the latest versions of the PDO drivers on the server. If you continue to have problems with the error, then you may want to copy the PHP.INI file into the root of the files for the website with the problem. Also copy phpinfo.php. You can then tell if it's loading properly. Scott further suggested the following (I already did the first line):
If that does not stop the error, ensure the extension_dir setting is commented out completely in the php.ini.
Set the following in your .htaccess file:
SetEnv PHPRC /home/cPanelUser/public_html/php.ini
Be sure to replaces your actual cpanel username where it says cPanelUser. This enables the pdo extensions and will hopefully remove the error.
Community Support will work with you generally through this interface and beyond if necessary. If you need immediate assistance using the chat interface, you would need to contact our live technical support team available 24/7.