Class 'SQLiteDatabase' not found

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Class 'SQLiteDatabase' not found

Postby trejder » 06. September 2012 10:05

I have XAMPP 1.8.0 installed (though it was installed quite time ago, so I don't have idea, if it isn't a beta or if it is Full or Lite) on Win 7 64-bit. I have 'php_sqlite3.dll' file in 'XAMPP\php\ext' dir. I have:

Code: Select all
extension=php_pdo_sqlite.dll (enabled)
;extension=php_pdo_sqlite_external.dll (disabled)
extension=php_sqlite3.dll (enabled)

in my php.ini and all sqlite configuration disabled:

Code: Select all
[sqlite]
; http://php.net/sqlite.assoc-case
;sqlite.assoc_case = 0

[sqlite3]
;sqlite3.extension_dir =

But I DON'T have sqlite (though I think I should after above):

Code: Select all
Fatal error: Class 'SQLiteDatabase' not found in C:\XAMPP\htdocs\sledz\code\index.php on line 7

Anyone got any idea, what is wrong? I'm pretty sure, that I've been using SQLite on XAMPP 1.7.2 Lite without any problems.

May sources (PHP docs, Internet) says that SQLite support in PHP is turned on by default and you have to do a lot of work, to disable it. But, by default, it should be supported without any problems. Seems, it isn't in XAMPP 1.8.0.

Thanks in advance for any help,
Trejder
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby JonB » 06. September 2012 15:07

What does it say in phpinfo()???

this is what 'my' 1.8.0 default install says -

PDO
PDO support enabled
PDO drivers mysql, sqlite

pdo_mysql
PDO Driver for MySQL enabled
Client API version mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $

pdo_sqlite
PDO Driver for SQLite 3.x enabled
SQLite Library 3.7.7.1

from 'my' php.ini

extension=php_pdo_sqlite.dll

that is the ONLY line I can find that references sqlite

Did you try to directly use a php.ini from a prior XAMPP install or a different configuration?
:?:


:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Class 'SQLiteDatabase' not found

Postby trejder » 07. September 2012 08:11

Hi,

JonB wrote:PDO
PDO support enabled
PDO drivers mysql, sqlite

Same here. Exactly, as on your example.

JonB wrote:pdo_mysql
PDO Driver for MySQL enabled
Client API version mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $

Exactly same here.

JonB wrote:pdo_sqlite
PDO Driver for SQLite 3.x enabled
SQLite Library 3.7.7.1

Same here. Same driver. All enabled.

Plus:
Code: Select all
sqlite3

SQLite3 support   enabled
SQLite3 module version   0.7
SQLite Library   3.7.7.1

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

I'm wondering, if exntesion_dir not set does not cause this problem?

JonB wrote:from 'my' php.ini
extension=php_pdo_sqlite.dll
that is the ONLY line I can find that references sqlite

I think that the fact, that you don't have extension=php_sqlite3.dll line enable (or even added) to your php.ini comes the fact, that you don't have additional part sqlite3 displayed in phpinfo(); I believe, the second extension is for procedural version of SQLite.

JonB wrote:Did you try to directly use a php.ini from a prior XAMPP install or a different configuration?

I've just checked, that my php.ini is 100% equal to the one that ships with XAMPP 1.8.0.

I have compared this ini file with the one that comes aboard my previous version (XAMPP 1.7.2 Lite) and found a strange differences around sqlite.

First of all, version 1.8.0 has only php_sqlite3.dll file. There is no php_sqlite.dll. This can be understood, as dropping support for old version of SQlite in new version of XAMPP. This is questionable decision itself, as there are enormously big changes in SQLite between version 2.1 and 3.0, which causes many developers to keep using version 2.1. But this is quite different problem, so let's not discuss it here.

What really surprised me, was founding that php_sqlite3.dll on board XAMPP 1.8.0 has size of 672 kB, while the very same file on board 1.7.2 has 1.21 MB. How should I understand this? I agree, that I didn't follow SQLite development, but I quite doubt that "developement" means degrading core library size by half!

I've tried to both add missing php_sqlite.dll extension and change php_sqlite3.dll 0,6 MB version with php_sqlite3.dll 1,2 MB version from XAMPP 1.7.2, but both operations failed with error saying, that there is no entry point of operation in php5ts.dll. So I reverted all my changes back to original state.

Even so, I'm still wondering, if missing SQL classes error does not comes from the fact that php_sqlite3.dll library on board newest XAMPP is somehow broken?

Another thing, a bit off-topic here is, how it is possible, that XAMPP 1.8.0 Full has only 10 MB of extensions for PHP, while XAMPP 1.7.2 Lite had 20 MB? Half less in full version than in lite?
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby JonB » 07. September 2012 14:40

Those are all questions that could only be answered by the XAMPP development team.

As you inferred - you should also research what is going on with the overall PHP development and SQLite.

For right now, I suggest you DL and look at the 1.8.1 beta. Take a look at how it works, and if it has support for what you need. If it doesn't -- Use the form on the beta page to contact/feedback to the developers. If they don't hear from you, they won't change things. :D

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Class 'SQLiteDatabase' not found

Postby trejder » 07. September 2012 19:28

Thanks for advice.

As for PHP dev support, I have worst thoughts possible. I bug in PHP PDO Oracle driver, reported in 2005, closed as fixed (not true) in 2006, reopened by me in 2011, still hasn't been fixed. Though someone need to change ONE line in source code to fix it and though it was initially reported SEVEN years ago!

So, they don't hear from me or others, because they don't generally listen to users.
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby JonB » 07. September 2012 19:55

I was thinking of XAMPP's developers on the matter of what gets included by default in the new releases. Of course, they are also hostages to the Perl, PHP, Apache and MySQL developers who work on the source...

I tell people all the time about the 'real problem' with Open Source - lots of 'broken crap' and 'abandoned ideas/projects' out there.

You could of course fix the source code and compile. (I know lots of work, but you would be some one's hero). Don't I remember Oracle changing its preferred client support???

Good Luck

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Class 'SQLiteDatabase' not found

Postby trejder » 07. September 2012 20:48

Fixing this particular error isn't a problem for me, nor it is not time consuming, as it is only one line (someone already provided patch and clear solution). The bigger problem for me would be to:

a) setup dev environemnt and recompile C code,

b) to remember to replace "their" (probably long time not fixed) version of pdo_oci.dll with "my", fixed.

But, that too off-topic. Let's focus on it. If you ever run into idea or information, what could be wrong with SQLDatabase, then let me know. I'll try to post here, if installing 1.8.1 fix that problem.

Thanks and Cheers,
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby trejder » 09. September 2012 13:53

Hi again,

I've been able to test the issue with following versions:

a) my good, old 1.7.3 Lite,
b) 1.8.0 freshly downloaded from your site,
c) 1.8.1 Beta, as well, from your site.

The issue with not working SQLite database does exits in both 1.8.x versions. SQLite works like a charm on 1.7.3 Lite.

I don't know what cause it, but the problem seems to be clearly XAMPP-version-independent. Maybe this is something with my computer (64-bit Compaq laptop) or my system (Win 7 Home 64-bit) or somewhere between.

In addition, I run into two more serious, strange problems with 1.8.x:

a) I WAS ABLE to login to phpMyAdmin with root/nopassword, though such user does not exitst (I removed it) in DB and though I changed PMA configuration to use cookie instead of config login type. After logging-in PMA acted strangely (for example, section "Users" dissapeared), but it doesn't change the fact, that I was able to login with non-existing user. XAMPP web security section also claimed that MySQL installation is open to security risk with root user without password enabled, though, after logging to PMA with different user (and "Users" section working) I cleary saw, that there isn't any such user. Changing PMA configuration to not accept empty password fixed the problem, dissallowing this strange root-user to login, but this is not enough, as for me, in security matters, even on development system.

b) After shutting down Apache and MySQL I wasn't able to restart MySQL, because XAMPP Control claimed: "Port 3306 in use by "c:\xampp8beta\xampp-control.exe". This is first time I was aware that XAMPP Control itself opens or uses any ports!

That is actually enough for me. I don't have time to chase ghosts and fight with strange errors. Either I'm really, really unlucky or you did some serious mess in 1.8.x. I've reverted myself back to old, good 1.7.3 Lite. The only reason I updated to 1.8.0 (then 1.8.1) was to have access to new XAMPP Control and newer version of phpMyAdmin. I was able to update both of them manually in my 1.7.3, so I stay at the old version, until you release 1.8.x with strange errors fixed and with SQLite support fully working.

By for now. Have a nice weekend!
Trejder
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby trejder » 16. May 2013 14:14

After nearly a year and upon second approach to this problem, I think I finally found a solution.

XAMPP 1.8.0 introduced PHP 5.4, which has dropped support for SQLite library in favor of SQLite3 library. SQLiteDatabase is an object that comes from the older one, unsupported as of now and that is why PHP under new XAMPP complies, that it can't find such class.

On ServerFault, StackOverflow and AskUbuntu you can find more information and details on this, including some of my answers and code migration examples.

There are two solution to this problem. Either try to find old library and use it in XAMPP without code migration or do the harder, but more promising work of migrating your code to use new SQLite3 library. Details under above mentioned links.

Before you begin, you have to first use a tool like SQLite Studio to convert your database file from 2.1 to 3.0. Size can be lowered by even a half, so I think it is something worth fighting for.
trejder
 
Posts: 42
Joined: 13. April 2008 06:45

Re: Class 'SQLiteDatabase' not found

Postby spector32 » 07. July 2013 22:17

Hi! I had the same problem, but i asked my friend Google about it and found something, that "promlem" is not in XAMPP but the PHP. How you know that in XAMPP 1.8.* PHP version is 5.4 and PHP developers made changes about SQLite that you should call object with

Code: Select all
new PDO('sqlite: some_database_path/database_name.db');

not

Code: Select all
new SQLiteDatabase('some_database_path/database_name.db');


This worked just fine for me!
Bye and good luck!
spector32
 
Posts: 1
Joined: 07. July 2013 22:03
XAMPP Version: 5.6.3
Operating System: MS Windows XP

Re: Class 'SQLiteDatabase' not found

Postby trejder » 08. July 2013 06:56

That PHP is 5.4 on board XAMPP 1.8.x I found by just using phpinfo() command in any of my PHP scripts. It gives you detailed information about entire PHP environment, you're using on particular server or system.

And as for details (and solution), I simply searched the Internet for the error message:

Code: Select all
Fatal error: Class 'SQLiteDatabase' not found

and it lead me to results on StackOverflow, AskUbuntu and others, that I pointed out in my previous post. That's all.
trejder
 
Posts: 42
Joined: 13. April 2008 06:45


Return to XAMPP for Windows

Who is online

Users browsing this forum: gsmith and 41 guests