I'm testing an upgrade from 6.16 to 7alpha6.
I followed the instructions in UPGRADE.txt, and after copying over my files and sites directories I tried to run update.php.
The result is:
"A PDO database driver is required!
You need to enable the PDO_ database driver for PHP 5.2.0 or higher so that Drupal 7 can access the database.
See the system requirements page for more information."
This is odd since I was using MAMP, which has PDO support built in. Since I've been meaning to anyway, I got apache2/php5/mysql5 working locally. Got it working, enabled PDO, but I still got the above error.
It's been a few years since I've configured PHP, so maybe I missed something, but here's the info I have from phpinfo:
PHP Version 5.3.1
System Darwin TSC-049M.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
Build Date Jul 21 2010 16:29:01
Configure Command './configure' '--prefix=/opt/local' '--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info' '--with-config-file-path=/opt/local/etc/php5' '--with-config-file-scan-dir=/opt/local/var/db/php5' '--disable-all' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-pdo' '--enable-phar' '--enable-session' '--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local' '--with-pcre-regex=/opt/local' '--with-readline=/opt/local' '--with-libxml-dir=/opt/local' '--with-zlib=/opt/local' '--without-pear' '--disable-cgi' '--with-ldap=/usr' '--with-apxs2=/opt/local/apache2/bin/apxs'
...
...
PDO
PDO support enabled
PDO drivers mysql
pdo_mysql
PDO Driver for MySQL enabled
Client API version mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
Persistent cache enabled
put_hits 0
put_misses 0
get_hits 0
get_misses 0
size 2000
free_items 2000
references 2
Directive Local Value Master Value
pdo_mysql.cache_size 2000 2000
pdo_mysql.default_socket /opt/local/var/run/mysql5/mysqld.sock /opt/local/var/run/mysql5/mysqld.sock
...
...
So, as far as I can tell, I do have PDO and the mysql PDO driver installed and this is a bug.
My Stats:
- OS X 10.6.4
- upgrading from D6.16 -> D7a6
- in MAMP: Apache 2.0.63, MySQL 5.1.37, PHP 5.2.10
- local install (all from MacPorts): Apache 2.2.14, MySQL 5.4.41, PHP 5.3.1
Wish I had time to troubleshoot this more to give more details and variations to find out where the problem is, but I need to get back to work.
Comments
Comment #1
rfayI got this same error upgrading a site from D6 (Ubuntu 10.04, php 5.2), and I run a clean install of Drupal 7 anytime, so it's not my PHP.
Comment #2
rfayComment #3
rfay@conanh: I resolved my issue. It was that I fat-fingered the settings.php.
I accidentally did this:
when I needed this:
(The $databases = array() is probably unnecessary, but it definitely needs to come BEFORE the actual default definition, or it wipes it all out.)
Comment #4
damien tournoud commentedWaiting for reproduction instructions, then :)
Comment #5
rfayIt may be worth doing something better with the error message, since I imagine this will result in future support requests.
Is there a real necessity for the $databases = array() statement in the default settings.php? Removing it would probably reduce the likelihood of this. The problem is that it's uncommented and below the demonstration database array assignments, so seems like it belongs below them. We could also just move it above them.
@conanh, please take a look at yours and see if it is the same thing.
Comment #6
conanh commentedSorry it took me so long to get back to this.
@rfay, I checked the formatting of my database array in settings.php, and it was wrong. For some reason I didn't have "['default']['default]" after $databases. Fixing that took care of the error that states that I don't have PDO (but gives me a PDO exception about not having a semaphore table--but I'll leave that for later).
So, it was a flub on my part, but from a non-core developer user of Drupal, more helpful errors would be great, which may need smarter checking. The fact that it said I didn't have a PDO driver had me looking in the wrong place.
And, BTW, I had the "$databases = array()" statement commented out.
Thanks for checking on this!
Comment #7
rfayI'm going to mark this fixed and as a support request. But I do think a better error message in this case would be great.