(dv) 4.0:Resolve PHP SQLite errors
- This page was last modified on April 6, 2011, at 07:40.
From (mt) Community Wiki
Contents |
Overview
The default configuration of the (dv) Dedicated-Virtual Server 4.0 product line lacks php-sqlite packages. This is because the (dv) 4.0 ships with SQLite 3.x (required for RPM) and the PHP packages were built for SQLite2.x.
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
Solutions
The following options are available for customers that want to use SQLite with their PHP applications:
Option 1
Use the PHP PDO extensions (PHP PDO methods and functions) to create/open SQLite databases. To do this, please consult the PHP PDO documentation relating to SQLite:
Option 2
Install SQLite 2.x and PHP SQLite RPM packages:
wget http://rpms.famillecollet.com/enterprise/5/remi/x86_64/sqlite2-2.8.17-2.el5.remi.x86_64.rpm wget http://rpms.famillecollet.com/enterprise/5/remi/x86_64/php-sqlite-5.3.5-1.el5.remi.1.x86_64.rpm RPM -ivh sqlite2-2.8.17-2.el5.remi.x86_64.rpm RPM -Uvh php-sqlite-5.3.5-1.el5.remi.1.x86_64.rpm service httpd restart
Option 2 is possible. This is because the SQLite 3.x package installs its files (libraries and binaries) as sqlite3, while the SQLite 2.x installs its packages as sqlite.
After a successful installation of SQLite 2.x and the php-sqlite package, your phpinfo() should have the SQLite section added to it. See Figure 1:
