Doc #54274 [Com]: SQLite class is not available on FreeBSD default installation
| From: | enterco at yahoo dot com | Date: | Thu, 17 Mar 2011 10:08:35 +0000 |
| Subject: | Doc #54274 [Com]: SQLite class is not available on FreeBSD default installation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6100@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54274&edit=1
ID: 54274
Comment by: enterco at yahoo dot com
Reported by: enterco at yahoo dot com
Summary: SQLite class is not available on FreeBSD default
installation
Status: Bogus
Type: Documentation Problem
Package: SQLite related
Operating System: FreeBSD
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
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 ?
Previous Comments:
------------------------------------------------------------------------
[2011-03-17 09:03:30] carsten_sttgt at gmx dot de
@aharvey
> 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.
BTW:
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 03:33:11] aharvey@php.net
The PHP manual only covers installs from stock PHP source using the
PHP build system. What FreeBSD does is down to the FreeBSD
maintainer(s).
------------------------------------------------------------------------
[2011-03-16 14:16:51] enterco at yahoo dot com
Description:
------------
---
From manual page: http://www.php.net/book.sqlite3
---
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:
---------------
<?php
$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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54274&edit=1