1

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

  • the extension_loaded function is rather contextual. Just check if any of the sqlite_ functions are present. – symcbean Apr 11 '13 at 23:09

3 Answers3

0

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.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • It is, indeed, the loaded configuration file. But I think there is some configure file somewhere passed at init time. Where would that be? – James John McGuire 'Jahmic' Sep 21 '11 at 09: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 – James John McGuire 'Jahmic' Sep 21 '11 at 10:49
0

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).

alexus
  • 13,112
  • 32
  • 117
  • 174
0

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972