Unable to connect to SQL server.

31 views
Skip to first unread message

Adam

unread,
May 1, 2008, 7:14:11 AM5/1/08
to webdns-support
Hello list!

I am trying to complete the installation of WebDNS on my Debian 4.1,
PHP 5.2.0, Horde 3.1.7
and I can access the login page at https://10.0.0.241/webdns/login.php
(note that I use SSL).
I get this error after I enter the username/password:
A fatal error has occurred
Unable to connect to SQL server.
Details have been logged for the administrator.

I looked at the MySQL logs and nothing is there (not even a connection
attempts).
/tmp/horde.log shows this error, but doesn't seems to help finding the
source of it...
I did all the stages in the INSTALL file, and even granted all
privileges for pdns user
and horde user to the MySQL databases.

Any help would be appreciated.
Adam.

Here is the content of registry.php:
$this->applications['horde'] = array(
'fileroot' => dirname(__FILE__) . '/..',
'webroot' => '/webdns/horde',
'initial_page' => 'login.php',
'name' => _("Horde"),
'status' => 'hidden',
'templates' => dirname(__FILE__) . '/../templates',
'provides' => 'horde'
);

$this->applications['webdns'] = array(
'fileroot' => dirname(__FILE__) . '/../..',
'webroot' => '/webdns',
'name' => _("WebDNS"),
'status' => 'active',
'templates' => dirname(__FILE__) . '/../../templates',
'provides' => 'dns_management'
);


Here is the content of horde/conf.php:
$conf['use_ssl'] = 2;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];

$conf['debug_level'] = E_ALL;
$conf['compress_pages'] = true;
$conf['menu']['always'] = false;
$conf['portal']['fixed_blocks'] = array();
$conf['imsp']['enabled'] = false;
$conf['kolab']['enabled'] = false;

$conf['session']['name'] = 'Horde';
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['timeout'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/';

$conf['sql']['phptype'] = 'mysql';
$conf['sql']['persistent'] = false;
$conf['sql']['protocol'] = 'tcp';
$conf['sql']['port'] = 3306;
$conf['sql']['hostspec'] = '10.0.0.241';
$conf['sql']['username'] = 'pdns';
$conf['sql']['password'] = 'xxxx';
$conf['sql']['database'] = 'pdns';
$conf['sql']['charset'] = 'iso-8859-1';

$conf['auth']['checkip'] = true;
$conf['auth']['params']['driverconfig'] = 'horde';
$conf['auth']['params']['table'] = 'horde_users';
$conf['auth']['params']['username_field'] = 'user_uid';
$conf['auth']['params']['password_field'] = 'user_pass';
$conf['auth']['params']['encryption'] = 'md5-hex';
$conf['auth']['params']['show_encryption'] = false;
$conf['auth']['driver'] = array('webdns', 'sql_webdns');
$conf['sql_webdns'] = $conf['sql'];

$conf['log']['priority'] = PEAR_LOG_INFO;
$conf['log']['ident'] = 'HORDE';
$conf['log']['params'] = array();
$conf['log']['name'] = '/tmp/horde.log';
$conf['log']['params']['append'] = true;
$conf['log']['type'] = 'file';
$conf['log']['enabled'] = true;
$conf['log_accesskeys'] = false;

$conf['prefs']['driver'] = 'sql';
$conf['datatree']['driver'] = 'null';

John Morrissey

unread,
May 1, 2008, 4:07:09 PM5/1/08
to webdns-...@googlegroups.com
On Thu, May 01, 2008 at 04:14:11AM -0700, Adam wrote:
> I am trying to complete the installation of WebDNS on my Debian 4.1,
> PHP 5.2.0, Horde 3.1.7
> and I can access the login page at https://10.0.0.241/webdns/login.php
> (note that I use SSL).
> I get this error after I enter the username/password:
> A fatal error has occurred
> Unable to connect to SQL server.
> Details have been logged for the administrator.

What exactly does your your /tmp/horde.log say?

> $conf['sql']['phptype'] = 'mysql';
> $conf['sql']['persistent'] = false;
> $conf['sql']['protocol'] = 'tcp';
> $conf['sql']['port'] = 3306;
> $conf['sql']['hostspec'] = '10.0.0.241';
> $conf['sql']['username'] = 'pdns';
> $conf['sql']['password'] = 'xxxx';
> $conf['sql']['database'] = 'pdns';
> $conf['sql']['charset'] = 'iso-8859-1';

Maybe this is asking the obvious, but have you tried using mysql(1) with
these settings to see if it's successful?

mysql -updns -pxxxx -h 10.0.0.241 pdns

john
--
John Morrissey _o /\ ---- __o
j...@horde.net _-< \_ / \ ---- < \,
www.horde.net/ __(_)/_(_)________/ \_______(_) /_(_)__

adam

unread,
May 7, 2008, 7:51:33 AM5/7/08
to webdns-support
Hi, thanks for your response.

Content of /tmp/horde.log:
May 07 10:43:53 HORDE [emergency] [webdns] Unable to connect to SQL
server. [on line 441 of "/var/www/dotsl/webdns/horde/lib/Horde/Auth/
sql.php"]

I used the mysql client with the exact same settings as in horde/
config/conf.php
and I was able to connect.

It looks like horde (or webdns) doesn't even try to access the MySQL -
even
if I change the IP in the horde/conf.php to something else I get the
exact
error.

Any suggestion?
Thanks!

On May 1, 11:07 pm, John Morrissey <j...@horde.net> wrote:
> On Thu, May 01, 2008 at 04:14:11AM -0700, Adam wrote:
> > I am trying to complete the installation of WebDNS on my Debian 4.1,
> > PHP 5.2.0, Horde 3.1.7
> > and I can access the login page athttps://10.0.0.241/webdns/login.php

adam

unread,
May 8, 2008, 5:36:31 PM5/8/08
to webdns-support
Solved!

I changed line 441 in webdns/horde/lib/Horde/Auth/sql.php
from:
Horde::fatal(_("Unable to connect to SQL server."), __FILE__,
__LINE__);
to:
Horde::fatal(_("Unable to connect to SQL server. ".$this->_db-
>getMessage()), __FILE__, __LINE__);

And I got the following (somewhat informative) error:
DB Error: extension not found

Google suggested that I have two versions of PHP installed. One with
PEAR and the other without.
It was probably true because dpkg showed I had both php4 (probably
preinstalled) along with php5.

So I removed all php occurrences with "dpkg --purge" and completely
reinstalled php using apt-get
and not from source.

I suggest to make the change in the webdns/horde/lib/Horde/Auth/
sql.php file permanent -
as I suggested above.

Thanks for your time guys!
> > j...@horde.net        _-< \_          /  \       ----  <  \,www.horde.net/  __(_)/_(_)________/    \_______(_) /_(_)__- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages