Php – Enabling Sqlite3 for php on fedora

apache-2.2fedoraPHPphp5sqlite

I am trying to get php with sqlite working on my fedora server. In the phpinfo is see that ./configure was set with the option –without-sqlite3. From what I have read these means that I might have to recompile or reinstall php with with sqlite. I was wondering how I would go about installing or configuring php with sqlite.(possibly a yum command?) thanks

Best Answer

All over the Internet you can find questions and answers regarding sqlite support in PHP on Fedora Core, Red Hat, and CentOS distributions. While many of them have differences in how to go about enabling support, all of them say the same thing about the cause: packages for PHP on those distributions are compiled without support for SQLite. To my knowledge there are no current RPM's for easily installing php-sqlite3.

I recommend you take a look at the comments found on PHP's SQLite Installation page that detail how to get it working as painlessly as possible. The short version is to ensure that you have php-devel installed (if not then run yum install php-devel) and do the following:

Download the source for PHP from http://php.net/downloads.php and compile it with support for the SQLite module.

tar xfvj php-5.3.2.tar.bz2 
cd php-5.3.2/ext/sqlite/
phpize
./configure
make
make install
/etc/init.d/httpd restart
Related Topic