Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

i cannot tell how exactly for suse this would work. in debian world it's:

apt-get install php5-sqlite

this will install needed library and add /etc/php5/conf.d/sqlite.ini with

extension=sqlite.so

so first - use yum to see install needed package, then add to php.ini line above.

share|improve this answer
    
apt-get seems to be a debian thing, there are workarounds (susewiki.org/index.php?title=Install-apt4suse) but I'm looking for the simplest solution here, there must be some way to just download and reference a sqlite library in Suse. –  Edward Tanguay Jun 28 '09 at 22:30
    
yum is the simple way –  freiheit Jun 28 '09 at 23:09
    
ok so I converted my VPS from Suse to Debian Linux 4.0 Standard 32-Bit. I type "apt-get install php5-sqlite" and it says "reading packge lists, building dependency tree...couldn't find package php5-sqlite". In /etc/php5/conf.d there are 8 other .ini files but not sqlite.ini. How come it couldn't find the package do I need to run that from a specific directory? (I type "yum" and it says "-bash: yum: command not found".) –  Edward Tanguay Jun 29 '09 at 0:25
    
Debian uses apt-get, Suse offers yum (and maybe zypper). If apt-get can't find the package, check that it exists and check which repositories you have in /etc/apt/sources.list and /etc/apt/sources.list.d. –  jldugger Jun 29 '09 at 1:31
    
in /etc/apt/sources.list.d I have one file called "debian.list" but no others, can I just download the library from somewhere and reference it in php.ini as on Windows, or does it need to be downloaded and installed somehow? –  Edward Tanguay Jun 29 '09 at 5:38

Linux mint 12 I was missing sqlite,

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0

Best practise for me it was download: http://packages.ubuntu.com/natty-updates/amd64/php5-sqlite/download unpacked sqlite.so to /usr/lib/php5/20090626/

share|improve this answer

here's a great tutorial on how to enble sqlite in a linkyx environment: http://www.exteon.ro/en/articles/php. Hope it helps!

share|improve this answer
1  
-1, That doesn't even cover the topic, and links to a generic page that may change. –  sysadmin1138 May 22 '11 at 0:44

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

--disable-sqlite

parameter is set in configure string.

share|improve this answer

Short version, but might be wrong because I don't know what package repositories your system is set up with:

yum install php5-sqlite

Long version:

yum search php sqlite

Or just search for one:

yum search sqlite

Look at the list that comes back. Figure out what you need, then:

yum install whatever_package_looked_right_from_the_list
share|improve this answer
    
+1: whatever package looked right –  fwilson Apr 2 '13 at 22:38

Your Answer

 
discard

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.