database preferences problems in RHEL5

David Severance <[email protected]> Tue, 12 Apr 2011 14:42:28 -0700
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
I've had a working Squirrelmail setup on RHEL4, PHP 4.3.9, Apache 2.0.52 
using SQM 1.4.21 for quite sometime. It stores it's user preferences on 
a remote mysql server (5.0.77). Recently, I was reminded of the 1 year 
end of life for RHEL4 so I proceeded to look into moving to a RHEL5 
based system for running Squirrelmail. That setup is RHEL5, PHP 5.1.6, 
Apache 2.2.3 using the exact same SQM 1.4.21. At once I realized RHEL5 
didn't include pear DB so I installed it (1.7.13 stable) using pear 
install. However the configtest fails, here is the output:

>
>   SquirrelMail configtest
>
> This script will try to check some aspects of your SquirrelMail 
> configuration and point you to errors whereever it can find them. You 
> need to go run conf.pl in the config/ directory first before you run 
> this script.
>
> SquirrelMail version: 	*1.4.21*
> Config file version: 	*1.4.0*
> Config file last modified: 	*11 April 2011 21:21:54*
>
> Checking PHP configuration...
>     PHP version 5.1.6 OK.
>     Running as apache(48) / apache(48)
>     display_errors:
>     error_reporting: 2047
>     variables_order OK: EGPCS.
>     PHP extensions OK. Dynamic loading is enabled.
> Checking paths...
>     Data dir OK.
>     Attachment dir OK.
>     Plugins OK.
>     Themes OK.
>     Default language OK.
>     Base URL detected as: https://webmail1.es.uci.edu/uci/src 
> (location base autodetected)
> Checking outgoing mail service....
>     SMTP server OK (220 smtp1.es.uci.edu ESMTP Sendmail 8.13.8/8.13.8; 
> Tue, 12 Apr 2011 14:23:48 -0700)
> Checking IMAP service....
>     IMAP server ready (* OK [CAPABILITY IMAP4 IMAP4REV1 LITERAL+] 
> perdition ready on localhost.localdomain 000241dd)
>     Capabilities: * CAPABILITY IMAP4 IMAP4REV1 LITERAL+
> Checking internationalization (i18n) settings...
>      gettext - Gettext functions are available. On some systems you 
> must have appropriate system locales compiled.
>      mbstring - Mbstring functions are available.
>      recode - Recode functions are unavailable.
>      iconv - Iconv functions are available.
>      timezone - Webmail users can change their time zone settings.
> Checking database functions...
>      PHP Pear DB support is present.
>
> *ERROR:* mysqli//squirrelmail database support not present or not 
> configured! Trying to dynamically load mysqli//squirrelmail extension. 
> Please note that it is advisable to not rely on dynamic loading of 
> extensions.
>
> *ERROR:* Database error: not found in preferences DSN.
>

When I try a login I get the dreaded

> Preference database error (not found). Exiting abnormally

which I have seen before when my database server is unreachable. To test 
this and to verify my pear DB installation I wrote a small snippet of 
php code below:

> <?
> require_once 'PEAR.php';
> require_once 'DB.php';
>
> $dsn = "mysqli://squirrelmail:[email protected]/squirrelmail";
>
> echo "<h1>Start</h1>\n";
> echo "<pre>\n";
>
> $db =& DB::connect($dsn);
> if (PEAR::isError($db)) {
>     die($db->getMessage());
> }
>
> // Proceed with a query...
> $res =& $db->query("SELECT * FROM userprefs WHERE user='estester'");
>
> // Always check that result is not an error
> if (PEAR::isError($res)) {
>     die($res->getMessage());
> }
>
> // Get each row of data on each iteration until
> // there are no more rows
> while ($res->fetchInto($row)) {
>     // Assuming DB's default fetchmode is DB_FETCHMODE_ORDERED
>     echo $row[0] . "\n";
> }
>
> echo "</pre>\n";
> echo "<h1>Stop</h1>\n";
> ?>

This works flawless in the browser and returns the preference data. I 
see nothing in the httpd logs to indicate any sort of problems at all. I 
then installed the debugger plugins and believe my install is correct 
looking at this output:

> My browser information:
>    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729)
>
> My web server information:
>    PHP Version 5.1.6
>    PHP Extensions (List)
>      * 0 = libxml
>      * 1 = xml
>      * 2 = wddx
>      * 3 = tokenizer
>      * 4 = sysvshm
>      * 5 = sysvsem
>      * 6 = sysvmsg
>      * 7 = standard
>      * 8 = SimpleXML
>      * 9 = sockets
>      * 10 = SPL
>      * 11 = shmop
>      * 12 = session
>      * 13 = Reflection
>      * 14 = pspell
>      * 15 = posix
>      * 16 = mime_magic
>      * 17 = iconv
>      * 18 = hash
>      * 19 = gmp
>      * 20 = gettext
>      * 21 = ftp
>      * 22 = exif
>      * 23 = date
>      * 24 = curl
>      * 25 = ctype
>      * 26 = calendar
>      * 27 = bz2
>      * 28 = zlib
>      * 29 = pcre
>      * 30 = openssl
>      * 31 = apache2handler
>      * 32 = dba
>      * 33 = dbase
>      * 34 = mbstring
>      * 35 = mysql
>      * 36 = mysqli
>      * 37 = PDO
>      * 38 = pdo_mysql
>      * 39 = pdo_sqlite
>
> SquirrelMail-specific information:
>    Version:  1.4.21
>    Plugins (List)
>      * 0 = compatibility
>      * 1 = squirrelspell
>      * 2 = add_address
>      * 3 = delete_move_next
>      * 4 = folder_sizes
>      * 5 = check_quota
>      * 6 = uci_look
>      * 7 = unsafe_image_rules
>      * 8 = message_details
>      * 9 = filters
>      * 10 = abook_import_export
>      * 11 = squirrel_logger
>      * 12 = view_as_html
>      * 13 = calendar
>      * 14 = msg_flags
>      * 15 = verify_reply_to
>      * 16 = forced_prefs
>      * 17 = debugger
>
> My IMAP server information:
>    Server type:  uw
>    Server info:  * OK [HIDDEN] IMAP4 IMAP4REV1 LITERAL+] perdition ready on localhost.localdomain 000241dd
>    Capabilities:  IMAP4 IMAP4REV1 LITERAL+

I couldn't go further with the debugger enabled because the login box 
wouldn't display. So I turned it off and then reloaded the login page 
and entered my credentials but didn't submit it until I re-enabled the 
debugger plugin. This output followed:

> *Stack Trace:*
>
> *session_start*()
> /var/www/squirrelmail/uci-squirrelmail-1.4.21/functions/global.php
> line *453*
>
> *sqsession_start*()
>     /var/www/squirrelmail/uci-squirrelmail-1.4.21/functions/global.php
>     line *433*
>
> *sqsession_is_active*()
>         /var/www/squirrelmail/uci-squirrelmail-1.4.21/functions/global.php
>         line *271*
>
> *sqsession_register*("https://webmail1.es.uci.edu", "sq_base_url")
>             /var/www/squirrelmail/uci-squirrelmail-1.4.21/functions/strings.php
>             line *405*
>
> *get_location*()
>                 /var/www/squirrelmail/uci-squirrelmail-1.4.21/src/redirect.php
>                 line *38*

I am at a loss to understand what I need to do to get SQM to work. Any 
help would be appreciated. I have already poked around the support pages 
looking for clues to no avail.

thanks,
David

-- 
David Severance
Central Computing Services
Office of Information Technology
(949) 824-7552
[email protected]


------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel