edo1z blog

プログラミングなどに関するブログです

centos6.5にsqlite2をインストール

参考:CentOS 5 に sqlite(2)をパッケージで入れる。(yumでインストール)

$ vim /etc/yum.repos.d/fedora.repo

fedora.repoの中身

[fc6extras]
name=Fedora Extras $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/6/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=extras-6&arch=$basearch
enabled=0
gpgkey=http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
gpgcheck=1

インストール

$ sudo yum install --enablerepo=fc6extras sqlite2

バージョン確認

$ sqlite -version

2.8.17

PHP5.3.3で使えるようにする

参考:centOS6.3のPHPでSQLite利用

$ sudo yum install -y wget
$ wget http://museum.php.net/php5/php-5.3.3.tar.gz
$ tar zxvf php-5.3.3.tar.gz
$ cd php-5.3.3/ext/sqlite
$ phpize
$ ./configure
$ make
$ make install
$ vi /etc/php.d/sqlite.ini

sqlite.iniのファイル内容

extension=sqlite.so
$ service httpd restart