<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Markus,<br>
<br>
You DB config and pear modules look just fine.<br>
I've just made some tests. I try to make a mistake in my DB config
and I get this:<br>
<br>
Warning: Creating default object from empty value in
/home/alex/_work/opensips_cp_full/opensips-cp-code/branches/6.0/config/db.inc.php
on line 25
Fatal error: Call to undefined method MDB2_Error::setFetchMode()
in
/home/alex/_work/opensips_cp_full/opensips-cp-code/branches/6.0/web/db_connect.php
on line 31
<br>
<br>
Try to editing the file : /var/www/opensips-cp/web/db_connect.php
and make it look like this :<br>
<?php<br>
require_once("../config/db.inc.php");<br>
require_once("MDB2.php");<br>
<br>
global $config;<br>
$dsn = $config->db_driver.'://' .
$config->db_user.':'.$config->db_pass . '@' .
$config->db_host . '/'. $config->db_name.'';<br>
$link = & MDB2::connect($dsn);<br>
<font color="#ff0000">if(PEAR::isError($link)) {<br>
die("Error while connecting : " .
$link->getMessage());<br>
}</font><br>
$link->setFetchMode(MDB2_FETCHMODE_ASSOC);<br>
if(PEAR::isError($link)) {<br>
die("Error while connecting : " .
$link->getMessage());<br>
}<br>
?><br>
<br>
This will give you some extra information why the connection is
not working.<br>
<br>
If you do not get any relevant information, for example I have
altered the DB name on purpose and I get "Error while connecting :
MDB2 Error: no such database", please try checking for selinux
policy.<br>
<br>
Just do a "setenforce 0" as root and check again if you still
experience the issue. If you don't then it's selinux. <br>
<br>
I hope this will solve your problem.<br>
<br>
Regards,<br>
Alex Ionescu<br>
<br>
<br>
<br>
I just made some tests. If I do a<br>
On 01/12/2015 02:11 PM, Markus Klaus Schäffauer wrote:<br>
</div>
<blockquote cite="mid:54B3B9D8.7040803@mkschaeffauer.de" type="cite">
<pre wrap="">Hello,
this is the relevant part of my /var/www/opensips-cp/config/db.inc.php :
###########################################
//database driver mysql or pgsql
$config->db_driver = "mysql";
//database host
$config->db_host = "localhost";
//database port - leave empty for default
$config->db_port = "";
//database connection user
$config->db_user = "root";
//database connection password
$config->db_pass = "opensipsrw";
//database name
$config->db_name = "opensips";
if (!empty($config->db_port) ) $config->db_host = $config->db_host .
":" . $config->db_port;
?>
############################################
And this is what "pear list" is listing:
############################################
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.12 stable
Auth 1.6.2 stable
Auth_SASL 1.0.4 stable
Console_Getopt 1.3.1 stable
HTTP_Request2 2.1.1 stable
Log 1.12.8 stable
MDB2 2.5.0b5 beta
MDB2_Driver_mysql 1.5.0b4 beta
Mail 1.2.0 stable
Mail_Mime 1.8.4 stable
Mail_mimeDecode 1.5.5 stable
Net_LDAP2 2.0.9 stable
Net_SMTP 1.6.1 stable
Net_Socket 1.0.9 stable
Net_URL 1.0.15 stable
Net_URL2 2.0.0 stable
PEAR 1.9.5 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.3 stable
############################################
Is that MDB2_Driver_mysql wrong here?
As I told before, I am not able to get pear/MDB2#mysql:
############################################
pear install MDB2#mysql
Skipping package "pear/MDB2", already installed as version 2.5.0b5
No valid packages found
install failed
############################################
I have no idea why pear does not find any valid packages of MDB2#mysql.
With kind regards,
Markus
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>