Submitted by manonamac on Tue, 01/25/2011 - 15:11
I've been having some issues with Drupal 7 since installation, namely enabling Clean URL's, some Views errors, etc. I remembered during the installation reading that PHP 5.2.5 was the minimum requirement for installation. I wasn't sure which version of PHP my server was running, I created a new php file called phpinfo.php with the following code:
phpinfo();Turns out I was running 5.2.15. Not being up to date on the latest versions, I assumed 5.2.15 was lesser than 5.2.5 (I found out later that I assumed incorrectly). Anyway, my host was running both 5.2.12 and 5.3.3, so I installed 5.3.3 by adding this to my .htaccess file :
Action application/x-hg-php53 /cgi-sys/php53 AddType application/x-hg-php53 .phpI ran phpinfo.php again, and saw PHP 5.3.3 successfully enabled. Problem is, when I went back to my site, I got the misleading "Fatal error: Class 'PDO' not found in /home/public_html/includes/database/database.inc on line 185" After a lot digging and going back-and-forth with my host, and realizing PDO was installed and enabled, and on my php.ini file these two line were already uncommented:
extension=pdo.so extension=pdo_mysql.soI even tried running the update.php script, but got this: "PDO is required! Drupal 7 requires PHP 5.2.4 or higher with the PHP Data Objects (PDO) extension enabled. See the system requirements page for more information." I found lots of info on http://drupal.org/requirements and http://drupal.org/requirements/pdo, but neither seemed to fix my specific issue. Finally, I found this page http://drupal.org/node/887288 after searching for answers to the error from the update script. While it didn't clearly explain (to me) what was happening in my instance, it did get me to try a different database connection array as indicated in the thread. This ended up WORKING for me with Drupal 7 and PHP 5.3.3:
With PHP 5.2.15 the database connection array performed well when formatted as:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'db_name',
'username' => 'db_username',
'password' => 'passwd',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
However when upgrading to PHP 5.3.3 the following format is required:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'db_name',
'username' => 'db_username',
'password' => 'passwd',
'host' => 'localhost',
'prefix' => '',
);