|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54274 SQLite class is not available on FreeBSD default installation
Submitted: 2011-03-16 14:16 UTC Modified: 2011-03-17 03:33 UTC
From: enterco at yahoo dot com Assigned:
Status: Not a bug Package: SQLite related
PHP Version: 5.3.5 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: enterco at yahoo dot com
New email:
PHP Version: OS:


 [2011-03-16 14:16 UTC] enterco at yahoo dot com
From manual page:
FreeBSD uses a 'port system' to install third party packages, including PHP. At this time, FreeBSD's port system is installing PHP as a 'main component' (the php binary, and/or apache module, etc) and every extension is installed separately.

PHP 5.3.5 documentation states that 'SQlite class is installed by default', but this does not happen on FreeBSD, probably because ./configure script is run with the following arguments: 
'Configure Command =>  './configure'  '--with-layout=GNU' '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix=' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--enable-zend-multibyte' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.2'

I have not tried a full source install instead of FreeBSD's default ports system, but I assume that '--disable-all' triggers '--without-sqlite3', so sqlite extension is no longer installed 'by default'.

A documentation update would be appreciate, so FreeBSD users will be informed about the reasons why SQLite3 is not available on this operating system by default. 
I expect SQLite3 will be enabled as an extension on FreeBSD by php port maintainters.

Test script:
$db_file = "sample.db";
$db = new SQLite3($db_file);
$sql="SELECT a, b FROM table1;";
$result = $db->query($sql);
while($res = $result->fetchArray(SQLITE3_ASSOC)) {
    echo $res['a']." ".$res['b']."\n";

Actual result:
PHP Fatal error:  Class 'SQLite3' not found in /test/sqlite/sqlite-error.php on line 3

Fatal error: Class 'SQLite3' not found in /test/sqlite/sqlite-error.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-17 03:33 UTC]
-Status: Open +Status: Bogus
 [2011-03-17 03:33 UTC]
The PHP manual only covers installs from stock PHP source using the
PHP build system. What FreeBSD does is down to the FreeBSD
 [2011-03-17 09:03 UTC] carsten_sttgt at gmx dot de

> The PHP manual only covers installs from stock PHP source using the
> PHP build system.

"--disable-all" is not FreeBSD related, it's an option from the normal PHP build system. I think you should reclassify this as a documentation problem. 

For other extensions with are enabled by default you can read something like:
| This extension is enabled by default, although it may be
| disabled by compiling with --without-foo .

But the second part is missing for SQlite.

It would be nice if there was a list in the manual with:
- extension which are in core (or enabled by default but can't be disabled, even with disable-all, like pcre)
- extension which enabled by default but can be disabled (e.g. with disable-all, --disable-foo), like SQlite.
 [2011-03-17 11:08 UTC] enterco at yahoo dot com
I don't know what may happen in the following scenario:
- the build system (regardless of it's name) does not have any sqlite libraries and headers usable by the compiler and linker
- php is built from source, using standard ./configure, which 'by default enables sqlite3', as [currently] documented

I assume that in this scenario won't be available _AND_ usable the SQlite3 class

SQlite3 class does not require some sqlite library to run ? 
Is there a sqlite bundle included with PHP ? Which version ?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 06:01:32 2024 UTC