PHP with sqlite3 support

How do I know if PHP is compiled with SQLite support? If this is not the case and I do not have privileges to change it, what alternatives do I need to read the SQLite database other than access to the php-sqlite3 functions?

+6
php sqlite3
source share
5 answers

I see that you specifically request support for SQLite v.3, so you should check PDO and PDO_sqlite . The internal php_sqlite extension php_sqlite supports SQLite v.2 in PHP 5 through 5.2. PHP 5.3 has a built-in extension php_sqlite3 , but I think this is not your case, since it was released only yesterday.

I believe that you are out of luck if your installation does not include it, since the proposed PEAR MDB2 is just an abstraction layer on top of existing drivers, it does not replace them.

+4
source share

phpinfo(); should tell you what compiled. Do the following:

 <?php phpinfo(); ?> 

and find sqlite in the HTML output.

+5
source share

If you got the php command line do the following:

 php -m 

The list should contain a list of SQLite.

If he's not there, I think you're out of luck (but I'm not sure)

+2
source share

If you don't have sqllite support built into php and cannot build it as an extension, you can 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/

0
source share

Assuming Debian Distributions

 apt-get install php5-sqlite 

or RedHat distributions

 yum install php5-sqlite 

and make sure sqlite3 is installed

0
source share

All Articles