Author Topic: Database Problems  (Read 8601 times)

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« on: November 01, 2008, 11:22:58 PM »
For some reason, after copying the data from the website of http://derekgordon.com:81/roundcubemail/index.php to a new website of RoundCube|Mail :: ERROR roundcube will not work on the new site.

The old site works fine still.

drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 bin
-rwxr-xr-x  1 web104_web web104 8.4K Nov  1 22:37 CHANGELOG
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 config
drwxr-xr-x  2 root       root   4.0K Nov  1 23:00 error
-rwxr-xr-x  1 web104_web web104  12K Nov  1 22:37 index.php
-rwxr-xr-x  1 web104_web web104 3.9K Nov  1 22:37 INSTALL
-rwxr-xr-x  1 web104_web web104  15K Nov  1 22:37 LICENSE
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 logs
drwxr-xr-x  7 web104_web web104 4.0K Nov  1 22:37 program
-rwxr-xr-x  1 web104_web web104 2.6K Nov  1 22:37 README
drwxr-xr-x  3 web104_web web104 4.0K Nov  1 22:37 skins
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 SQL
lrwxrwxrwx  1 root       root     56 Nov  1 23:16 sqlite.db -> /home/admispconfig/ispconfig/web/roundcubemail/sqlite.db
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 temp
-rwxr-xr-x  1 web104_web web104 1.8K Nov  1 22:37 UPGRADING

Originally sqlite.db was copied and not SYMLINKED.  It doesn't work either way...


$rcmail_config['db_dsnw'] = 'sqlite://./sqlite.db?mode=0646';

Please help!  Thanks!

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Database Problems
« Reply #1 on: November 02, 2008, 10:14:10 AM »
You'd have to remove the symlink (rm -f sqlite.db) then copy the old one over to the new one (cp /home/admispconfig/ispconfig/web/root/roundcubemail/sqlite.db ./sqlite.db) and then change permissions on it (chown web104_web:web104 sqlite.db) and that should be it.
 
  

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« Reply #2 on: November 02, 2008, 06:44:37 PM »
Still the same thing.
DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.



[dingle@its web]# rm -f sqlite.db
[dingle@its web]# cp /home/admispconfig/ispconfig/web/root/roundcubemail/sqlite.db ./sqlite.db
cp: cannot stat `/home/admispconfig/ispconfig/web/root/roundcubemail/sqlite.db': No such file or directory
[dingle@its web]# cp /home/admispconfig/ispconfig/web/roundcubemail/sqlite.db ./sqlite.db
[dingle@its web]# chown web104_web:web104 sqlite.db
[dingle@its web]#


drwxrwxr-x 11 web104_web web104 4.0K Nov  2 18:43 .
drwxr-xr-x  8 web104_web web104 4.0K Nov  2 04:00 ..
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 bin
-rwxr-xr-x  1 web104_web web104 8.4K Nov  1 22:37 CHANGELOG
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 config
drwxr-xr-x  2 root       root   4.0K Nov  1 23:00 error
-rwxr-xr-x  1 web104_web web104  12K Nov  1 22:37 index.php
-rwxr-xr-x  1 web104_web web104 3.9K Nov  1 22:37 INSTALL
-rwxr-xr-x  1 web104_web web104  15K Nov  1 22:37 LICENSE
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 logs
drwxr-xr-x  7 web104_web web104 4.0K Nov  1 22:37 program
-rwxr-xr-x  1 web104_web web104 2.6K Nov  1 22:37 README
drwxr-xr-x  3 web104_web web104 4.0K Nov  1 22:37 skins
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 SQL
-rwxr-xr-x  1 web104_web web104 464K Nov  2 18:43 sqlite.db
drwxr-xr-x  2 web104_web web104 4.0K Nov  2 04:00 stats
drwxr-xr-x  2 web104_web web104 4.0K Nov  1 22:37 temp
-rwxr-xr-x  1 web104_web web104 1.8K Nov  1 22:37 UPGRADING

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Database Problems
« Reply #3 on: November 02, 2008, 10:23:24 PM »
Okay, next question, your db.inc.php is set up properly?
 
  

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« Reply #4 on: November 02, 2008, 10:43:22 PM »
It's the exact same on both pages.  One page works, the other doesn't.

Here's the file for webmail.derekgordon.com:
Code: [Select]
<?php

/*
 +-----------------------------------------------------------------------+
 | Configuration file for database access                                |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 +-----------------------------------------------------------------------+

*/

$rcmail_config = array();

// PEAR database DSN for read/write operations
// format is db_provider://user:password@host/databse
// currently supported db_providers: mysql, sqlite

$rcmail_config['db_dsnw'] = 'sqlite://./sqlite.db?mode=0646';
// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
// sqlite example: 'sqlite://./sqlite.db?mode=0646';

// PEAR database DSN for read only operations (if empty write database will be used)
// useful for database replication
$rcmail_config['db_dsnr'] = '';

// database backend to use (only db or mdb2 are supported)
$rcmail_config['db_backend'] = 'db';

// maximum length of a query in bytes
$rcmail_config['db_max_length'] = 512000;  // 500K

// use persistent db-connections
// beware this will not &quot;always&quot; work as expected
// see: http://www.php.net/manual/en/features.persistent-connections.php
$rcmail_config['db_persistent'] = FALSE;


// you can define specific table names used to store webmail data
$rcmail_config['db_table_users'] = 'users';

$rcmail_config['db_table_identities'] = 'identities';

$rcmail_config['db_table_contacts'] = 'contacts';

$rcmail_config['db_table_session'] = 'session';

$rcmail_config['db_table_cache'] = 'cache';

$rcmail_config['db_table_messages'] = 'messages';


// you can define specific sequence names used in PostgreSQL
$rcmail_config['db_sequence_users'] = 'user_ids';

$rcmail_config['db_sequence_identities'] = 'identity_ids';

$rcmail_config['db_sequence_contacts'] = 'contact_ids';

$rcmail_config['db_sequence_cache'] = 'cache_ids';

$rcmail_config['db_sequence_messages'] = 'message_ids';


// end db config file
?>



The code for the WORKING roundcube that I copied all data over locally:
Code: [Select]

<?php

/*
 +-----------------------------------------------------------------------+
 | Configuration file for database access                                |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 +-----------------------------------------------------------------------+

*/

$rcmail_config = array();

// PEAR database DSN for read/write operations
// format is db_provider://user:password@host/databse
// currently supported db_providers: mysql, sqlite

$rcmail_config['db_dsnw'] = 'sqlite://./sqlite.db?mode=0646';
// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
// sqlite example: 'sqlite://./sqlite.db?mode=0646';

// PEAR database DSN for read only operations (if empty write database will be used)
// useful for database replication
$rcmail_config['db_dsnr'] = '';

// database backend to use (only db or mdb2 are supported)
$rcmail_config['db_backend'] = 'db';

// maximum length of a query in bytes
$rcmail_config['db_max_length'] = 512000;  // 500K

// use persistent db-connections
// beware this will not &quot;always&quot; work as expected
// see: http://www.php.net/manual/en/features.persistent-connections.php
$rcmail_config['db_persistent'] = FALSE;


// you can define specific table names used to store webmail data
$rcmail_config['db_table_users'] = 'users';

$rcmail_config['db_table_identities'] = 'identities';

$rcmail_config['db_table_contacts'] = 'contacts';

$rcmail_config['db_table_session'] = 'session';

$rcmail_config['db_table_cache'] = 'cache';

$rcmail_config['db_table_messages'] = 'messages';


// you can define specific sequence names used in PostgreSQL
$rcmail_config['db_sequence_users'] = 'user_ids';

$rcmail_config['db_sequence_identities'] = 'identity_ids';

$rcmail_config['db_sequence_contacts'] = 'contact_ids';

$rcmail_config['db_sequence_cache'] = 'cache_ids';

$rcmail_config['db_sequence_messages'] = 'message_ids';


// end db config file
?>
« Last Edit: November 02, 2008, 10:45:42 PM by crypted »

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Database Problems
« Reply #5 on: November 02, 2008, 11:25:54 PM »
Instead of "./sqlite.db" use "../sqlite.db" since technically the sqlite.db is in the directory above db.inc.php; or, move sqlite.db into the db.inc.php directory.
 
  

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« Reply #6 on: November 03, 2008, 12:03:39 AM »
I changed it in the DB, didn't work.  So, I returned the DB to the normal state and MV'ed the sqlite.db into config/ and still no go.  

Error 4 reporting:
DB Error in /var/www/web104/web/program/include/rcube_db.inc (105): DB Error: extension not found

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent in /var/www/web104/web/program/include/main.inc on line 76

Warning: Cannot modify header information - headers already sent in /var/www/web104/web/program/include/rcube_html.inc on line 163


Is it possible to import a SQLITE.DB to Mysql?  I could change both to goto Mysql in the DB's.  Sqllite.DB on the working website has been used for a year or so...  Don't want to lose it.
« Last Edit: November 03, 2008, 12:09:28 AM by crypted »

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Database Problems
« Reply #7 on: November 03, 2008, 07:03:59 AM »
Yeah, if you use phpMyAdmin or something you should be able to import it.  Or you could go into your sqlite manager, export the data & tables and then run that sql script in the "SQL" tab of phpMyAdmin.

Sounds like this server doesn't have the sqlite extension loaded though.  Does phpinfo() output any information about sqlite being available?
 
  

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« Reply #8 on: November 03, 2008, 09:49:32 AM »
I don't see how one site would work and the other not if there weren't extensions...?

Code: [Select]
System Linux its.derekgordon.com 2.6.18-92.1.13.el5 #1 SMP Wed Sep 24 19:33:52 EDT 2008 i686
Build Date Jul 16 2008 19:54:37
Configure Command './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/usr/share/file/magic.mime' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter'

,,,,,,,

additional .ini files parsed /etc/php.d/dbase.ini, /etc/php.d/dom.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/ldap.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini

,,,,,,,

PDO
PDO support enabled
PDO drivers mysql, odbc, sqlite
,,,,,,,,,,,,,,,,,

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library 3.3.6


The top says '--without-sqlite' in the configuration but it says sqlite in other places like it's there?  Again, don't see how one site works if it isn't there...

/etc/php.d/pdo_sqlite.ini has the following:

Code: [Select]
; Enable pdo_sqlite extension module
extension=pdo_sqlite.so

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Database Problems
« Reply #9 on: November 03, 2008, 10:55:18 AM »
Okay, do a on some page and do a search for SQLite (not PDO).  I'm pretty sure that your other server has sqlite while this one has pdo_sqlite.
 
  

Offline crypted

  • Newbie
  • *
  • Posts: 6
Database Problems
« Reply #10 on: November 03, 2008, 11:35:34 AM »
The files are on the same server.  However, phpinfo() has no SQLITE showing.  Only PDO.  How do I somehow incorporate SQLITE in without recompiling the world?  This is a recompiled HTTPD/PHP install from ISPConfig.  THe last update must have lost SQLITE for php...  

I really don't know how to solve this part...  I mean how can one page work and the other not when both run on the same server?
« Last Edit: November 03, 2008, 11:09:42 PM by crypted »