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.

I've seen similar questions but none that address my situation adequately. I'm running Apache and PHP 5.3.6 on a amazon cloud server.

phpinfo keeps stating that sqlite is disabled. At least that what it seems from the configure line:

'./configure' ... '--without-sqlite'

In other parts of phpinfo() output:

PDO
PDO drivers     mysql, sqlite
PDO Driver for SQLite 3.x   enabled
SQLite Library  3.6.20 

sqlite3
SQLite3 support enabled
SQLite3 module version  0.7-dev
SQLite Library  3.6.20

Directive   Local Value Master Value
sqlite3.extension_dir   no value    no value

and at least one the following PHP commands fail:

if (!extension_loaded('SQLite') OR !function_exists('sqlite_open'))

Yum install states that both sqlite and pdo-lite are already installed.

I've tried to enable sqlite by editing my local php.ini by adding:

; Enable sqlite3 extension module
extension=sqlite3.so

I've checked the main php.ini (/etc/php.ini) and there is nothing specific about disabling it. In fact, there is a sub-conig file loaded in php.d that also specifies this extension as well as another for the pdo-sqlite

I'm running of things to look for or try. Any suggestions.

How do I find where the PHP configure is stated?

Thanks

share|improve this question
    
the extension_loaded function is rather contextual. Just check if any of the sqlite_ functions are present. –  symcbean Apr 11 '13 at 23:09
add comment

3 Answers

up vote 0 down vote accepted

Your code doesn't specify the extension name correctly, so of course it fails. The correct extension name, as we see, is sqlite3.

if (!extension_loaded('SQLite')...

Anyway.

The RPM build of PHP actually rebuilds PHP four separate times. It is built once without any extensions enabled, for loading into Apache as mod_php, then built again with all extensions as shared memory objects. And a build for the PHP command line, and a fourth build whose purpose I forget right now.

So what happens is, the builds with no extensions built in are bundled with the extensions built from the other build. Thus PHP may say that it was configured without any extensions, yet still be able to use them.

share|improve this answer
    
Hey, Thanks for contributing an answer. But, my eyes still aren't seeing the where this is happening. Could you be a bit more specific as to where? I can't recall how I moved on from this issue. –  Jahmic Aug 13 '13 at 12:28
    
@Jahmic SQLite isn't the same as sqlite3. :) –  Michael Hampton Aug 13 '13 at 13:41
    
I see now... Anyways, long moved on from this issue. forget how, but thus far, this seems like the most likely cause. –  Jahmic Aug 28 '13 at 10:01
add comment

Make sure that /etc/php.ini appeared in the Loaded Configuration File line.

--without-sqlite don't talk about whether sqlite library is installed or not. Search sqlite in phpinfo() page to see if you have SQLite Library enabled.

share|improve this answer
    
It is, indeed, the loaded configuration file. But I think there is some configure file somewhere passed at init time. Where would that be? –  Jahmic Sep 21 '11 at 9:02
    
In other parts of phpinfo() output: PDO: PDO drivers mysql, sqlite PDO Driver for SQLite 3.x enabled SQLite Library 3.6.20 sqlite3 SQLite3 support enabled SQLite3 module version 0.7-dev SQLite Library 3.6.20 Directive Local Value Master Value sqlite3.extension_dir no value no value –  Jahmic Sep 21 '11 at 10:49
add comment

Whenever you're doing phpinfo(); make sure you're looking at right php.ini (I think all of us been there where you're looking at one php.ini when another php.ini is being used) so look at "Loaded Configuration File", and another thing look at "Scan this dir for additional .ini files" on my RHEL system it shows that I have /etc/php.d/ where more of php.ini files resides (including sqlite3.ini).

share|improve this answer
add comment

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.