许多托管服务提供商的梨数据库问题

时间:2021-02-18 07:13:06

I Connect and Query My Db Using PEAR DB Like This:

我使用PEAR DB连接和查询我的Db像这样:

if(stristr($_SERVER['HTTP_HOST']  , 'localhost')){
    $dsn = 'mysql://root:@localhost/xxx' ;
}else{
    $dsn = 'mysql://xxx:xxx@localhost/xxx' ;
}
$dbc =& DB::connect($dsn);
$dbc->query("set names utf8" );
if (PEAR::isError($dbc , array('debug'=>3))) {
    die($dbc->getMessage());
}

In some hosting providers it's working perfectly and for example, if the database user doesn't have sufficient permissions, it says: Insufficient Permission, and some other errors. Also, when I fix the problem, the site will come up and runs well.

在某些托管服务提供商中,它工作得很好,例如,如果数据库用户没有足够的权限,它会说:权限不足,以及其他一些错误。此外,当我解决问题时,该网站将出现并运行良好。

However, in many hosting providers it doesn't show many errors! And nothing on the page either! The page is completely blank, no errors, no notice, nothing! I've also set error_reporting(E_ALL) in top of my script, and I still can't find the bug. Is there any solution for such a problem?

但是,在许多托管服务提供商中,它没有显示很多错误!页面上也没有任何内容!页面完全空白,没有错误,没有通知,没有!我还在我的脚本中设置了error_reporting(E_ALL),但我仍然无法找到错误。有这样一个问题的解决方案吗?

1 个解决方案

#1


Make sure display_errors is on (or check the logs):

确保display_errors已打开(或检查日志):

ini_set('display_errors', true);

#1


Make sure display_errors is on (or check the logs):

确保display_errors已打开(或检查日志):

ini_set('display_errors', true);