From: "Malka Cymbalista" on
Hi all, we are running Apache 2.2.6 and PHP 5.2.6 on a Linux machine. If someone gets an error when displaying a php web page, he does not get any error message on the screen. The arror is written into the apache error log file, but most users don't have access to the apache error logand i would like the user to see the error on the screen.
Is there anything I can do?
thanks for any help.



Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista(a)weizmann.ac.il
08-934-3036

From: Nilesh Govindarajan on
On 05/16/2010 05:09 PM, Malka Cymbalista wrote:
> Hi all, we are running Apache 2.2.6 and PHP 5.2.6 on a Linux machine. If someone gets an error when displaying a php web page, he does not get any error message on the screen. The arror is written into the apache error log file, but most users don't have access to the apache error logand i would like the user to see the error on the screen.
> Is there anything I can do?
> thanks for any help.
>
>
>
> Malka Cymbalista
> Webmaster, Weizmann Institute of Science
> malki.cymbalista(a)weizmann.ac.il
> 08-934-3036
>
>

In php.ini, set error_reporting = On

Note if you override that somewhere, then change it at the overriding
point. Also, there may be some application specific setting, like in
Drupal, you can configure whether the errors are written to the dblog or
dblog and screen.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !
From: Ashley Sheridan on
On Sun, 2010-05-16 at 14:39 +0300, Malka Cymbalista wrote:

> Hi all, we are running Apache 2.2.6 and PHP 5.2.6 on a Linux machine. If someone gets an error when displaying a php web page, he does not get any error message on the screen. The arror is written into the apache error log file, but most users don't have access to the apache error logand i would like the user to see the error on the screen.
> Is there anything I can do?
> thanks for any help.
>
>
>
> Malka Cymbalista
> Webmaster, Weizmann Institute of Science
> malki.cymbalista(a)weizmann.ac.il
> 08-934-3036
>


By most users I assume you mean the developers, as it's not a very good
idea to display errors to actual users of your app (it gives information
away which could be used to break your system and allow them access to
your server)

There is a section inside the php.ini that you can use. Look for the
display_errors flag and set it to on. Just above or below that line
should be another which determines the exact type of errors to display.
The documentation within the ini file itself should show you some
examples.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Nilesh Govindarajan on
On 05/16/2010 05:21 PM, Nilesh Govindarajan wrote:
> On 05/16/2010 05:09 PM, Malka Cymbalista wrote:
>> Hi all, we are running Apache 2.2.6 and PHP 5.2.6 on a Linux machine.
>> If someone gets an error when displaying a php web page, he does not
>> get any error message on the screen. The arror is written into the
>> apache error log file, but most users don't have access to the apache
>> error logand i would like the user to see the error on the screen.
>> Is there anything I can do?
>> thanks for any help.
>>
>>
>>
>> Malka Cymbalista
>> Webmaster, Weizmann Institute of Science
>> malki.cymbalista(a)weizmann.ac.il
>> 08-934-3036
>>
>>
>
> In php.ini, set error_reporting = On
>
> Note if you override that somewhere, then change it at the overriding
> point. Also, there may be some application specific setting, like in
> Drupal, you can configure whether the errors are written to the dblog or
> dblog and screen.
>

Oops oops oops. I put the wrong setting, change display_errors to On.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !
From: Al on


On 5/16/2010 7:39 AM, Malka Cymbalista wrote:
> Hi all, we are running Apache 2.2.6 and PHP 5.2.6 on a Linux machine. If someone gets an error when displaying a php web page, he does not get any error message on the screen. The arror is written into the apache error log file, but most users don't have access to the apache error logand i would like the user to see the error on the screen.
> Is there anything I can do?
> thanks for any help.
>
>
>
> Malka Cymbalista
> Webmaster, Weizmann Institute of Science
> malki.cymbalista(a)weizmann.ac.il
> 08-934-3036
>
>


if(true) // TRUE for debug only
{
ini_set("display_errors", "on"); //use off if users will see them
error_reporting(E_ALL);

$error_reporting = '<span style="color:red">Error display and logging
on</span>';
}

I echo $error_reporting in the body of of my html page to remind me it is on.

This also creates an error log in the working dir.