Drupal 7 on Debian Lenny - PDO Troubleshooting

I just spent a very frustrating 2 days trying to install Drupal 7 after upgrading Debian Etch to Lenny. The issue is due, in part, to the new database abstraction approach, which uses PDO. My solution to the problem is below, as I explain here:

http://drupal.org/node/784062#comment-2932820

Solution! After 20 hours of troubleshooting (and not understanding Damien''s comment #13), I suspect this a pecl problem. Do NOT USE pecl for pdo_mysql on Lenny! That is unfortunate because Google searches for "install pdo lenny" currently yield this link (http://blog.nethazard.net/how-to-install-php-pdo-on-debian-lenny/), where the suggestion is pecl. However, as explained in a comment from that link, Lenny php5-common and php5-mysql packages *include* the correct pdo extensions, so there''s no need to use pecl. I would add that you should AVOID pecl or expect the issues explained above (indeed because pecl compiles a REALLY OLD version that Drupal doesn''t like). In case it helps others, I realized that this issue happened to me after "#apt-get dist-upgrade" (from etch to lenny)

Solution:

1. pecl uninstall pdo_mysql

2. pecl uninstall pdo

3. Probably overkill when php5-common and php5-mysql are sufficient, but: #apt-get remove apache2 mysql-server libapache2-mod-php5 libapache2-mod-ruby php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

4. run #3 again but "#apt-get install" instead of remove

5. update/verify that your php.ini uses extension=pdo.so and extension=pdo_mysql.so

This works by removing all of the (pecl) pdo.so and pdo_mysql.so files, then reinstalling the newer versions from php5-common and php5-mysql.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.