Re: error warning while connecting to posgreSQL
| From: | Ashley Sheridan | Date: | Sun, 28 Sep 2008 09:11:47 +0000 |
| Subject: | Re: error warning while connecting to posgreSQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281068@lists.php.net to get a copy of this message | ||
On Sun, 2008-09-28 at 11:00 +0200, Alain Roger wrote:
> Hi,
>
> i try to understand the error_reporting statement and to avoid all warning
> or error messages.
> for example i stop the postgresql service and i try to connect to it.
> when error_reporting is set to E_ALL, i get the following warning :
> *Warning*: pg_connect()
>
> [function.pg-connect<https://192.168.1.2/se_admin/en/logon/function.pg-connect>]:
> Unable to connect to PostgreSQL server: could not connect to server:
> Connection refused (0x0000274D/10061) Is the server running on host
> "localhost" and accepting TCP/IP connections on port 5432? in *
> L:\Webserver\se\log\checklogin.php* on line *48*
> Couldn't Connect:
>
> but if i have the error_reporting set to 0, i only get my die message
> "Couldn't connect".
>
> i would like to know if i let the setting "E_ALL" do i have a way how to not
> display the warning message to end users but to display only "Couldn't
> connect" ?
> in fact to have the same behavior as error_reporting set to 0.
> thx.
>
I don't think you set error reporting to an actual number in the
php.ini. It should read something like
error_reporting = E_ALL & ~E_WARNING
if you want all errors but not the warnings.
Ash
www.ashleysheridan.co.uk