Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i just realized that the rpm version of php that i have installed on the server don't have sqlite support (well it have the PDO support but for some reason don't work)

so i installed as a PECL extension, and now it show the support on the phpinfo() but still the open inviter script give me the error of:

Call to undefined function sqlite_open()

and i already restarted httpd also

any hint where i can find a solution or guide?

share|improve this question

Remove php* packages and install equivalent php53* packages - they're available since RHEL/CentOS 5.6. They support sqlite PDO out of the box.

You can test this. Create a file /tmp/test-pdo-sqlite.php with contents:

try {
        $dbh=new PDO('sqlite:test.sqlite');
        $version = $dbh->query('select sqlite_version()')->fetchColumn();
        echo $version, "\n";
} catch (PDOException $e) {
        trigger_error("Error!: " . $e->getMessage(),E_USER_ERROR);

And run it with cd /tmp/; php test-pdo-sqlite.php - on my CentOS 5 with php53 I get:


I have the following packages installed:

$ rpm -qa --qf='%{NAME}\n' | grep php | sort
share|improve this answer

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 it was not built into these distributions since Fedora Core 4). To my knowledge there are no current RPM's for easily installing php-sqlite3.

Additionally, it is not recommended that you install the PECL extension for SQLite, as that is deprecated and no longer supported.

That being said, PHP on these distributions does include support for php-pdo and you can use that to access sqlite databases. The primary differences are the connection strings (you do not use sqlite_open but instead use a pdo string - for example: $db = new PDO('sqlite:/tmp/foo.db');). A list of sqlite functions using PDO can be found in the PHP Manual. I believe that if you modify your code to use these functions instead of the functions in php-sqlite that your problems will be solved.

If you need php-sqlite support and php-pdo does not work, you can try the following to recompile php with support for php-sqlite. Download the source for PHP from and compile it with support for the SQLite module.

tar xfvj php-5.3.2.tar.bz2 
cd php-5.3.2/ext/sqlite/
make install
/etc/init.d/httpd restart
share|improve this answer
sorry but this didn't work, even the phpinfo() show the support of sqlite3, i'm getting the same error. the change of the code to support PDO is not a option in this case. – shadow_of__soul Jul 25 '10 at 19:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.