Install SQLite3 in CentOS

Just to make sure that I remember what I did when SQLite3 driver was missing when I installed [or upgraded] php on the CentOS server.

  1. Install php

    yum install httpd httpd-devel

  2. check sqlite version

    yum info sqlite

  3. Install compiler to compile the sqlite3 driver

    yum install gcc

  4. Update the php-devel

    rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
    yum –enablerepo=webtatic update php-devel

  5. Download and extract difference php version

    wget http://de.php.net/get/php-5.3.6.tar.gz/from/this/mirror
    tar zxvf php-5.3.6.tar.gz

  6. Go to sqlite3 folder in newly downloaded php folder and copy/rename config file.

    cd php-5.3.6/ext/sqlite3/
    cp config0.m4 config.m4

  7. then compile

    phpize
    ./configure
    make
    make install

     

  8. We will get sqlite3.so. We need to point that driver in php. So we create the file “/etc/php.d/sqlite3.ini” which has

    extension=sqlite3.so

  9. Finally, we restart the apache.

    /etc/init.d/httpd restart

    You can able to connect to sqlite database now. :)

ref: stackoverflow and bnode.org

Quick ‘n’ Easy LAMP Server For CentOS/RHEL

Also read...

Comments

Leave a Reply