I'm getting this error message on my new Drupal 7 installation
Fatal error: Class 'PDO' not found in /home/.../public_html/drupal/includes/database/database.inc on line 184
Update: I've added the php.ini file to my root/drupal folder
Code which I've added to that
memory_limit = 128M
safe_mode = off
session.cache_limiter = nocache
open_basedir = none
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.soI also followed the instructions at http://wiki.lunarpages.com/Php.ini_settings
"Then, add the following line into the .htaccess file in your public_html"suPHP_ConfigPath /home/username/public_html
and I'm still getting the same error message. Please help me to resolve this problem.
In created and uploaded a phpinfo.php file and viewed the results but I don't know what I'm supposed to look for.
------
I'm trying to get a new Drupal 7 installation running
My host is Lunarpages
I searched the forum and I see others had the same problem (but maybe in Drupal 6 it was a memory problem?). Can somebody explain to me more clearly how to resolve this problem. I am technically adept, and computer literate, but not a webmaster-php-whiz.
In my Drupal installation there is no php.ini file in root/drupal
*The post http://drupal.org/node/570452 says*
PDO support had been compiled in, but not enabled .
Adding
extension=pdo.so
extension=pdo_mysql.so
to my php.ini solved the problem."
*matw8 resolved his problem with by adding the below*
http://drupal.org/node/1067176
memory_limit = 128M
safe_mode = off
session.cache_limiter = nocache
open_basedir = none
extension = pdo.so
extension = pdo_mysql.so
*On my site Drupal is installed in root/drupal
the php.ini file in root contains*
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
In my Drupal installation there is no php.ini file in root/drupal
Other related posts:
http://diggit.drupalextras.com/node/11503/related_links
http://diggit.drupalextras.com/node/78837/related_links
http://diggit.drupalextras.com/node/42309/related_links
http://diggit.drupalextras.com/node/16903/related_links
Comments
Hi, I think I've documented
Hi, I think I've documented the problem well. I've also continued trying to resolve the problem. Please give me some guidance. I'm stuck.
Started from Scratch, Error Messages
Problem Resolved: I started over from scratch, and this time I paid close attention to the error messages.
I posted a message to the Lunarpages Help Desk:
I attempted to install Drupal today and I got the below error messages. How do I fix these.
1. PHP extensions ***Error
PHP extensions Disabled
Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):
2. pdo ****Error
Database support Disabled
Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the system requirements page for more information.
3. PHP Memory *** Warning
PHP memory limit 8M
Consider increasing your PHP memory limit to 32M to help prevent errors in the installation process. Increase the memory limit by editing the memory_limit parameter in the file /home/balazs2/public_html/php.ini and then restart your web server (or contact your system administrator or hosting provider for assistance). See the Drupal requirements for more information.
Thank you for contacting Lunarpages Internet Solutions & Web Hosting.
......
The helpful response I got from the Lunarpages Help Desk
1) If you want to enable all disabled function for your account. Please add the following code in your php.ini (this file is not created by default you would need to upload or create it in public_html)
==================
disabled_functions = ""
==================
2.) To enable PDO, please try adding the following lines into your php.ini file which can be located under your public_html folder (this file is not given by default you would need to manually create or upload it).
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
3.) Because we use suPHP to parse php files, you have the option of using a custom php.ini file.
You can change the settings for the PHP directives in your php.ini file which can be located under your public_html folder (this file is not given by default you would need to manually create or upload it) by adding the following code:
memory_limit = 32M
You can also create a .htaccess file in the same folder as the php.ini file and place the following code into it:
suPHP_ConfigPath /home/username/public_html/
where "username" is your cPanel username. This will cause the php.ini file to affect all subfolders, unless a php.ini file is in a subfolder, at which point the php.ini in the subfolder takes precedence.
You should only use the settings you need to change in your php.ini.
For the PHP settings you do not have in your php.ini file, PHP will use our default configurations.
Solved : memory size exhausted & PDO class problem
I have just installed Drupal 7 & have been having memory problems whilst in admin tasks, particularly with the Views module which completely failed to save a new view I was trying to create.
The error was:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/thedest1/public_html/rhemahousing.co.uk/dr/modules/ckeditor/includes/ckeditor.page.inc on line 113
I tried adding a php.ini file to my /drupal folder. The file had the contents:
php_value memory_limit = "128M"
this resulted in a different error:
Fatal error: Class 'PDO' not found in .... /includes/database/database.inc on line 184
I have now placed the following code in a php.ini file in my drupal directory. This has solved the problem. I don't understand why, but I'm happy!
php_value memory_limit = "128M"
safe_mode = off
session.cache_limiter = nocache
open_basedir = none
extension = pdo.so
extension = pdo_mysql.so
I hope this helps anyone else with a similar problem.
OK
problem solved with this solution, thanks.
having this issue..
line 184 in the
includes/database/database.inc
/**
* Base Database API class.
*
* This class provides a Drupal-specific extension of the PDO database
* abstraction class in PHP. Every database driver implementation must provide a
* concrete implementation of it to support special handling required by that
* database.
*
* @see http://php.net/manual/en/book.pdo.php
*/
abstract class DatabaseConnection extends PDO {
/**
...
added the lines above for a local php.ini file but didn't work.. wondering if I need to modify the top level directory php.ini file which I do not have access to..
''The secret though is just keep walking through life without analyzing it too much or clinging to it too much. Just walk on.'' - Marilyn Silverstone, Magnum Photographer & Buddhist Nun, b. March 9, 1929, October 1999.
worked w my hosting provider to find the solution here..
http://drupal.org/node/1036110
added a revised php.ini to the main directory and issue was resolved..
''The secret though is just keep walking through life without analyzing it too much or clinging to it too much. Just walk on.'' - Marilyn Silverstone, Magnum Photographer & Buddhist Nun, b. March 9, 1929, October 1999.
Yeppers this worked for me.
Yeppers this worked for me. THANKS!!!!
Also Check Extension_Dir
I had the same situation and tried everything listed here, and it still wouldn't work.
Then I realized that I must have set extension_dir some time in the past. I just commented it out and it worked (just let it use the default value).
HTH.