Re: Altering the error_reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 3, 2008 at 10:30 PM, Tom Chubb <tomchubb@xxxxxxxxx> wrote:

> 2008/9/3 n3or <info@xxxxxxx>
>
> > admin@xxxxxxxxxxxxxxxxxxx schrieb:
> >
> >> I am looking for a way to alter the error_reporting(E_All)
> >>  This displays Parse error: parse error, unexpected '}' in
> >> /var/www/html/test.php on line 7
> >>
> >> I want to remove the file location and line number from the error
> >> to only produce
> >> Parse error: parse error, unexpected '}'
> >>
> >> Why? You may ask.
> >>
> >> I am writting a code tester in php but i do not want to display the "in"
> >> portion. This will make you find the error on your own. As a learning
> tool.
> >>
> >> Understand I have error reporting off in the php.ini file and call the
> >> errors in the php script with ini_set('display_errors', 1);.
> >>
> >> I am sure this is doable I just cant figure out how to do this without
> >> altering the php.ini file.
> >>
> >>
> >>
> > Hi,
> > you could define your own error handler:
> > http://www.php.net/manual/en/function.set-error-handler.php
> >
> >
> >
> > The manual made me chuckle then: "Also note that it is your
> responsibility
> to die() <http://www.php.net/manual/en/function.die.php> if necessary"


It's true, you should die sometimes, but is possible we really wanna know
something.
But if its only to hide information, then is better to redirect for a 500
error page.
If you really to show this part of error, best thing I know is eval.

-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux