6

How do I know if PHP is compiled with SQLite support? If it's not, and I don't have the privileges to change it, what alternatives do I have to read an SQLite database besides access to php-sqlite3 functions?

5 Answers 5

5

phpinfo(); should tell you what's compiled in. Execute that:

<?php

phpinfo();

?>

and look for sqlite within the HTML output.

Sign up to request clarification or add additional context in comments.

Comments

4

I see that you specifically ask for SQLite v.3 support, so what you have to check is PDO and PDO_sqlite support. The native php_sqlite extension only supports SQLite v.2 in PHP 5 to 5.2. PHP 5.3 has a native php_sqlite3 extension, but I guess this is not your case, as it has been released just yesterday.

I believe you're out of luck if your setup doesn't include that, as the suggested PEAR MDB2 is just an abstraction layer over existing drivers, it does not substitute them.

Comments

2

if you got command line php, do this:

php -m

SQLite should then be in the list.

If it is not there then I believe your out of luck (but I'am not sure)

Comments

0

If you do not have sqllite support built in to php, and cannot build it as an extension, you could always try the pear extension http://pear.php.net/package/MDB2.

I have not used it myself, but it claims to support sqllite http://pear.php.net/package/MDB2_Driver_sqlite/

1 Comment

whoops, missed that it was only an abstraction above the sqllite driver, scratch this :)
0

Assuming Debian distros

apt-get install php5-sqlite

or RedHat distros

yum install php5-sqlite

and make sure sqlite3 is installed

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.