Reputation: 4983
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?
Upvotes: 6
Views: 3814
Reputation: 3660
Assuming Debian distros
apt-get install php5-sqlite
or RedHat distros
yum install php5-sqlite
and make sure sqlite3 is installed
Upvotes: 0
Reputation: 3948
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.
Upvotes: 4
Reputation: 2049
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/
Upvotes: 0
Reputation: 38216
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)
Upvotes: 2
Reputation: 342635
phpinfo();
should tell you what's compiled in. Execute that:
<?php
phpinfo();
?>
and look for sqlite within the HTML output.
Upvotes: 5