PHP SQLite搞砸了

I tried installing SQLite for my system, it didn't work. Now any time I try to run PHP code though the terminal, this error is given:

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

It's very annoying that I can't run PHP scripts.. Anyone know what I can do to fix this? I did a quick search on Google to fix the error and I couldn't find anything.

Looks like your PHP configuration includes a line similar to extension=sqlite3.so. This configuration is typically inside /etc/php/ or /etc/php5/. Try grep -r sqlite * in that directory to find which config file mentions it, comment out that line using ;, and restart your webserver.

I actually had this problem and blogged about it. With Ubuntu, the problem didn't lie in the PHP.ini has most resources would lead you to believe. Inside the /etc/php5/conf.d directory was a bunch of .ini files for different extensions including sqlite.ini and sqlite3.ini.

If you look in the sqlite3.ini file, you'll see something like:

; configuration for php SQLite module
extension=sqlite3.so 

All you have to do is comment that line so it looks like this:

; configuration for php SQLite module
; extension=sqlite3.so 

This way it's not trying to look for the sqlite3.so file and will probably use your sqlite.so instead.