2

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

2 Answers 2

0

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
2
  • In case anyone happens to come across this answer in the year 2013 or later, note that it is completely obsolete.
    – mattdm
    Dec 5, 2013 at 5:25
  • Also, the above procedure will turn an rpm-based system into one that has a mix of RPMs and randomly-installed software, leading to a management nightmare.
    – mattdm
    Dec 5, 2013 at 5:26
8

You do not need to recompile anything. In fedora you can get the sqlite php module by installing the php-pdo module. The following should do the trick.

yum install php-pdo

The reason your seeing php as having been built without sqlite is so fedora can split the php package and thus not force a big string of dependencies on people who don't want them. For instance you need sqlite and thus likely you do not need postgresql. If fedora was to build the main mod_php application with all --with's turned on you would end up installing postgresql without needing or wanting it. This helps people concerned with both security (only install exactly the software needed) and people concerned with package download bandwidth.

3
  • I believe that on Fedora Core at least, you do still have to recompile - at least on my Fedora 13 server I did. Php-pdo was installed and up to date, but if I wanted to use connect using the sqlite functions (us3.php.net/manual/en/ref.sqlite.php) instead of the functions that are included with pdo-sqlite (php.net/manual/en/ref.pdo-sqlite.php) I had to recompile - at the very least the connection was different. I admit, though, it could have been a mistake on my part, but that was my experience. Jul 16, 2010 at 22:07
  • 1
    I can say from direct recent experience that the mediawiki application works correctly with an sqlite database with just the php-pdo package installed under rhel5.
    – Banis
    Jul 16, 2010 at 23:00
  • This holds true Fedora 19. Entering yum install php-pdo @ the command line gives us access to SQLite3. Double check with rpm -l php-pdo if so required.
    – user191920
    Sep 28, 2013 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .