[OpenSIPS-Users] [opensips_cp]: Blank Page after Login
Alex Ionescu
alex at opensips.org
Mon Jan 12 17:23:14 CET 2015
Hi Markus,
You DB config and pear modules look just fine.
I've just made some tests. I try to make a mistake in my DB config and I
get this:
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
Try to editing the file : /var/www/opensips-cp/web/db_connect.php and
make it look like this :
<?php
require_once("../config/db.inc.php");
require_once("MDB2.php");
global $config;
$dsn = $config->db_driver.'://' .
$config->db_user.':'.$config->db_pass . '@' . $config->db_host . '/'.
$config->db_name.'';
$link = & MDB2::connect($dsn);
if(PEAR::isError($link)) {
die("Error while connecting : " . $link->getMessage());
}
$link->setFetchMode(MDB2_FETCHMODE_ASSOC);
if(PEAR::isError($link)) {
die("Error while connecting : " . $link->getMessage());
}
?>
This will give you some extra information why the connection is not working.
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.
Just do a "setenforce 0" as root and check again if you still experience
the issue. If you don't then it's selinux.
I hope this will solve your problem.
Regards,
Alex Ionescu
I just made some tests. If I do a
On 01/12/2015 02:11 PM, Markus Klaus Schäffauer wrote:
> 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
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150112/9687ea75/attachment.htm>
More information about the Users
mailing list