# sqlite3 support

**URL:** <https://community.freepbx.org/t/sqlite3-support/3223>\
**Category:** Installation / Upgrade\
**Created:** [February 9, 2008, 9:38am UTC](https://community.freepbx.org/t/sqlite3-support/3223 "2008-02-09T09:38:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![drowe67](https://community.freepbx.org/user_avatar/community.freepbx.org/drowe67/32/4963_2.png) [@drowe67](https://community.freepbx.org/u/drowe67)\
**Post date:** [February 9, 2008, 9:38am UTC](https://community.freepbx.org/t/sqlite3-support/3223/1 "2008-02-09T09:38:53Z")

</div>

Hi,

I am interested in getting FreePBX running on an embedded Asterisk system, for example: [http://rowetel.com/ip04](http://rowetel.com/ip04), using sqlite3 rather than mysql.

As a first step I am trying to get FreePBX 2.4.0beta2 to run using sqlite3 on an Ubuntu x86 box. I have compiled PHP 5.2.5 and FreePBX runs Ok with mysql.

However when I swap to sqlite (as per the sqlite.readme file) I get errors like “undefined property” in theDB\_common-\>quoteSmart( ) function,which traces to a missing variable:

Notice: Undefined property: DB\_sqlite3::$dbsyntax in /usr/local/apache/php/lib/php/DB/common.php on line 451

The variable dbsyntax doesn’t exist in the sqlite3.php DB backend file I found on the PHP site. I suspect this file might be out of date compared the other PHP/DB files in my PHP install.

Could anyone please comment on the correct PHP version, DB version, and sqlite3.php files for sqlite3 support?

Thanks,

David

---

<div class="post-metadata">

**Author:** ![cleal](https://community.freepbx.org/letter_avatar_proxy/v4/letter/c/e9a140/32.png) [@cleal](https://community.freepbx.org/u/cleal)\
**Post date:** [February 10, 2008, 12:12am UTC](https://community.freepbx.org/t/sqlite3-support/3223/2 "2008-02-10T00:12:50Z")

</div>

David, does the patch at [http://www.freebsd.org/cgi/query-pr.cgi?pr=108074](http://www.freebsd.org/cgi/query-pr.cgi?pr=108074) offer any clues?

–Carlos

---

<div class="post-metadata">

**Author:** ![drowe67](https://community.freepbx.org/user_avatar/community.freepbx.org/drowe67/32/4963_2.png) [@drowe67](https://community.freepbx.org/u/drowe67)\
**Post date:** [February 10, 2008, 6:46am UTC](https://community.freepbx.org/t/sqlite3-support/3223/3 "2008-02-10T06:46:42Z")

</div>

Thanks Carlos, but I think the problem is that we need an up to date version of sqlite3.php, the interface between PEAR:DB and the sqlite3 libraries. The sqlite3 libraries actually seems to be compiled into PHP 5 BTW, so we just need the missing link as above.

Cheers,

David

---

<div class="post-metadata">

**Author:** ![Li\_Yuqian](https://community.freepbx.org/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@Li\_Yuqian](https://community.freepbx.org/u/Li_Yuqian)\
**Post date:** [February 12, 2008, 3:06am UTC](https://community.freepbx.org/t/sqlite3-support/3223/4 "2008-02-12T03:06:05Z")

</div>

Hi David,

i am try install the freepbx2.4.0 with sqlite3 at past few days on a x86 PC, now i am get ready for sqlite3, just have a sql error.

## i used some softwares version are:

## php-4.3.9 php-pear-4.3.9 sqlite-3.3.6 sqlite3-0.5 for php-sqlite3.php

some bugs needs fixed for sqlite3 support:

1. newinstall.sqlite3.sql at line 378 add `mohclass` varchar(80) NOT NULL default ‘default’, `sipname` varchar(50) default NULL
2. change newinstall.sqlite3.sql at line 330 from “modules\_xml” to “module\_xml”
3. change newinstall.sqlite3.sql at line 35 “2.2.0beta3” to “2.4.0”

and i can install almost modules and create a extension, but if i click “apply changes” will show a FATAL SQL error:  
[FATAL] SQL -  
SELECT t.variable, t.value, d.value state FROM `globals` t JOIN (SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE ‘OUTDISABLE\_%’) d ON substring(t.variable,5) = substring(d.variable,12) WHERE t.variable LIKE ‘OUT\_%’ UNION ALL SELECT v.variable, v.value, concat(substring(v.value,1,0),‘off’) state FROM `globals` v WHERE v.variable LIKE ‘OUT\_%’ AND concat(‘OUTDISABLE\_’,substring(v.variable,5)) NOT IN ( SELECT variable from globals WHERE variable LIKE ‘OUTDISABLE\_%’ ) ORDER BY variable

1 error(s) occured, you should view the notification log on the dashboard or main screen to check for more details.

I am not a sql guy, so any guys can help me fix this sql error? thanks,

Li

---

<div class="post-metadata">

**Author:** ![drowe67](https://community.freepbx.org/user_avatar/community.freepbx.org/drowe67/32/4963_2.png) [@drowe67](https://community.freepbx.org/u/drowe67)\
**Post date:** [February 12, 2008, 3:35am UTC](https://community.freepbx.org/t/sqlite3-support/3223/5 "2008-02-12T03:35:09Z")

</div>

Hi Li,

OK thats interesting that with PHP 4 the existing php3.sql backend must work OK. Nice. Thats might save some work.

Yes, I was also getting SQL errors like that - I used xdebug to track them down. I one case (admin/modules/core/functions.inc.php:2671) there was some simpler SQL code commented out that I used for now.

Cheers,

David

---

<div class="post-metadata">

**Author:** ![markt](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@markt](https://community.freepbx.org/u/markt)\
**Post date:** [February 18, 2008, 10:12pm UTC](https://community.freepbx.org/t/sqlite3-support/3223/6 "2008-02-18T22:12:45Z")

</div>

Well,  
I am proud to announce that we have the first version of FreePBX/sqlite combo working in Astfin.  
Some polishing is still needed mostly to shrink it in size, but overall we are in business.

Cheers,  
Mark

---

<div class="post-metadata">

**Author:** ![ted](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@ted](https://community.freepbx.org/u/ted)\
**Post date:** [August 6, 2010, 2:01pm UTC](https://community.freepbx.org/t/sqlite3-support/3223/7 "2010-08-06T14:01:18Z")

</div>

Hi guys,

Does somebody have a correct sqlite3.php file please?  
I have installed freepbx-2.8.0 and I have the following error:  
Fatal error: Call to undefined function sqlite3\_open() in /usr/share/pear/DB/sqlite3.php on line 90  
In fact I have found the sqlite3.php file here  
[http://sourceforge.net/projects/php-sqlite3/files/source%20code/release%200.5/sqlite3-0.5.tgz/download](http://sourceforge.net/projects/php-sqlite3/files/source%20code/release%200.5/sqlite3-0.5.tgz/download)

Can somebody help me please ?

Thanks in advance

ted

---

<div class="post-metadata">

**Author:** ![ted](https://community.freepbx.org/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@ted](https://community.freepbx.org/u/ted)\
**Post date:** [August 6, 2010, 2:48pm UTC](https://community.freepbx.org/t/sqlite3-support/3223/8 "2010-08-06T14:48:13Z")

</div>

Hi,

Where did you get this file please sqlite3.php?  
I am also locking for it?

Thanks in advance for you help

ted

---

<div class="post-metadata">

**Author:** ![system](https://community.freepbx.org/uploads/default/original/3X/f/7/f7056d57e04fdbf71c6ad967e1ced351317f5c3f.png) [@system](https://community.freepbx.org/u/system)\
**Post date:** [June 4, 2014, 6:35pm UTC](https://community.freepbx.org/t/sqlite3-support/3223/9 "2014-06-04T18:35:49Z")

</div>

Closed on June 4, 2014, 6:35pm UTC


