To enable SQLite on my Windows/Apache/PHP setup, I uncomment the following lines in the php.ini file and restart Apache:
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
Now I have a VPS with Suse Linux 10.3 and Apache/PHP was set automatically. Looking through the php.ini file to make the above changes, I see that things are a little different on Linux:
- there is no list of extensions to uncomment
- I found "
extension_dir = /usr/lib/php5/extensions
" but in this directory find only:- pdo.so
- pdo_mysql.so
How can I enable SQLite in this Linux environment?
i cannot tell how exactly for suse this would work. in debian world it's:
this will install needed library and add /etc/php5/conf.d/sqlite.ini with
so first - use yum to see install needed package, then add to php.ini line above.
EDIT: for php7 the command is:
and php.ini file is located at:
sudo nano /etc/php/7.0/apache2/php.ini
where you have to enable theextension=sqlite.so
Short version, but might be wrong because I don't know what package repositories your system is set up with:
Long version:
Or just search for one:
Look at the list that comes back. Figure out what you need, then:
SQLite support is enabled by default on a standard Linux PHP compilation starting with PHP 5.0.
Which PHP version do you use? Did you checked the phpinfo() output to see if SQLite is enabled? SQLite will be enabled unless the
parameter is set in configure string.
Linux Mint 12 was missing sqlite and it was generating the following error:
Best practise for me it was to download and unpack
sqlite.so
to/usr/lib/php5/20090626/