sqlite2 là một extension cài đặt vào trong PHP, nhưng CentOS không tạo gói rpm cho nó. Bạn có thể thử cách sau:
Bước 1: Tạm gỡ bỏ php-sqlite
Mã:
|
yum remove -y php-sqlite* |
Bước 2: Tiến hành update PHP như bình thường
Mã:
|
yum install php
yum install php-devel # cài đặt thêm gói php-devel nếu bạn chưa có |
Bước 3: Gõ lệnh
Bước 4: Giải nén gói mã nguồn PHP và compile extension sử dụng lệnh phpize:
Mã:
|
cd /usr/src/redhat/SOURCES
tar zxvf php-5.2.6.tar.gz
cd php-5.2.6/ext/sqlite
phpize
./configure
make install |
Bước 5: Tạo tập tin /etc/php.d/sqlite.ini để tải extension này lên
Mã:
|
ls -l /usr/lib/php/modules/sqlite.so
-rwxr-xr-x 1 root root 871225 Apr 7 18:07 /usr/lib/php/modules/sqlite.so
cd /etc/php.d
vi sqlite.ini
; Enable sqlite extension module
extension=sqlite.so
:wq |