Author Topic: Installation not working with SQLite  (Read 22841 times)

Offline LonelyPixel

  • Jr. Member
  • **
  • Posts: 32
Installation not working with SQLite
« on: May 06, 2008, 04:15:38 PM »
Hi,

I've been looking at RoundCube from time to time, but now I finally got to install it on my web server. But it doesn't work very well here. This is the blocking bug right now: The SQLite database cannot be initialised. Here's what the installer said:

Quote
Check configured database settings
Backend: PEAR::MDB2
DSN (write):  OK
Warning: sqlite_create_function() expects parameter 1 to be resource, integer given in /www/web001/roundcube/program/include/rcube_mdb2.inc on line 598 Warning: sqlite_create_function() expects parameter 1 to be resource, integer given in /www/web001/roundcube/program/include/rcube_mdb2.inc on line 599 Warning: sqlite_create_function() expects parameter 1 to be resource, integer given in /www/web001/roundcube/program/include/rcube_mdb2.inc on line 600 Warning: sqlite_create_function() expects parameter 1 to be resource, integer given in /www/web001/roundcube/program/include/rcube_mdb2.inc on line 601 Warning: sqlite_last_error() expects parameter 1 to be resource, integer given in /www/web001/roundcube/program/lib/MDB2/Driver/sqlite.php on line 534 DB Schema:  NOT OK(Error creating database schema: MDB2 Error: unknown error Query: _doQuery: [Error message: Could not execute statement] [Last executed query: CREATE TABLE cache ( cache_id integer NOT NULL PRIMARY KEY, user_id integer NOT NULL default 0, session_id varchar(40) default NULL, cache_key varchar(128) NOT NULL default '', created datetime NOT NULL default '0000-00-00 00:00:00', data longtext NOT NULL ); ] [Native message: sqlite_last_error() expects parameter 1 to be resource, integer given] )

Please try to inizialize the database manually as described in the INSTALL guide. Make sure that the configured database extists and that the user as write privileges

Not sure what happened here. Running PHP 5.2.5 with SQLite support enabled and working fine for several other applications. All previous checks of the RC installer were passed.

Another thing is that the PHP files of RC are written in a way that they can never work without a problem: You start HTML output first and then start the PHP session. I cannot imagine how you didn't notice that during the very first development steps... Starting a PHP session sends an HTTP header, but those cannot be sent after HTTP body has started. How is that supposed to work? The easiest solution would be to put a at the very beginning of every page that starts a PHP session. The more elegant would be to only write page content after starting the session.

Edit: I've read the INSTALL file and it says that PHP 5 and SQLite 2 are required... Doesn't PHP 5 always come with SQLite 3 only? What's the problem with version 3, which is current for ages by now and working for all my other projects (web and desktop)?

Edit 2: I don't have any "sqlite" binary on that web server machine (running Linux). Where can I get such a database file to start using RoundCube? The SQL dump is quite useless to me if the installer is broken and I don't have the tool to do it on my own.
« Last Edit: May 06, 2008, 04:35:54 PM by LonelyPixel »

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Installation not working with SQLite
« Reply #1 on: May 07, 2008, 04:01:34 AM »
Hi,

I struggled for several days in vain to get RC working with sqlite; I posted several times here without getting anywhere. Eventually I just gave up and used postgres instead, which works fine, but I am not sure I need the firepower of a high-end RDBMS for my modest requirements.

As I mentioned in an earlier post, it would be nice to get sqlite working. Sorry I can't be of more specific help.

Good luck...

Offline xrx

  • Newbie
  • *
  • Posts: 1
Installation not working with SQLite
« Reply #2 on: November 28, 2008, 04:44:19 AM »
I got the same errors you did, but here's a quick fix: try editing the config/db.inc.php file, and change the line:
$rcmail_config['db_dsnw'] = 'sqlite://roundcubemail?mode=0646';
to
$rcmail_config['db_dsnw'] = 'sqlite:////var/www/roundcube/sqlite.db?mode=0646';
(change the path accordingly).

Offline grooverdan

  • Newbie
  • *
  • Posts: 9
reported as bug
« Reply #3 on: April 25, 2009, 11:13:24 PM »
added trac ticket 1485821