PDO SQLite Apache2 boondoggle on Debian-platforms

Using Debian (my favorite Linux platform, if you've not had the chance to hear me sing its praises) I ran into some craziness when I tried to upgrade my Apache2 install on Lenny (Debian 5). The task was to get MySQL's PDO driver installed: when I did the expected

pecl install PDO_MYSQL

All of a sudden my PHP executions started producing errors that looked like this:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/pdo_sqlite.so' - /usr/lib/php5/20060613/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/sqlite.so' - /usr/lib/php5/20060613/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0

After going to the Google well for water and coming up dry (which is astonishing considering the number of people out there with the same issue, just search for this to see what I mean), I lost an hour of my life trying to get that error message to go away (I have 550 emails in my inbox from the cron jobs that fell apart when the PHP install broke: that'll teach me to do server updates at 3am and then go to sleep).

Finally figured it out: for some reason PHP STILL includes support for the original sqlite, but what you REALLY want is sqlite3 (don't ask me what happened to sqlite2). To clean it up you have to COMPLETELY uninstall the sqlite libraries and then install the sqlite3 libraries. This is what did it for me on my server (your experience may vary depending on which Debian revision you have in hand; you'll need to have php-pear installed as well):

apt-get remove php5-sqlite
apt-get remove sqlite
pecl uninstall SQLite
apt-get install libsqlite3-dev
pecl install sqlite3
pecl install PDO_SQLITE

You may need to enter the path to libsqlite3 when running the pecl sqlite install, and you may have to manually edit the config files in /etc/php5/conf.d/sqlite.ini to get it to load the sqlite3.so library instead of the sqlite.so library, but after that I was golden.

P.S. If you're looking to use your Android phone as a Bluetooth GPS device, checkout SolidSync Network/Bluetooth GPS in the Google Play Store or on the web at http://solidsync.com/networkbluetooth-gps.

Image

Need to send mail in a hurry?

Try Send Overnight Mail for your FedEx Overnight, USPS Priority Express or USPS Priority mailing needs. Send Overnight Mail is the easiest way to send overnight mail, online or offline: early-morning orders can even be sent same day!