You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "asiani@wanadoo.fr" <as...@wanadoo.fr> on 2004/10/06 08:36:35 UTC

[users@httpd] Error page

Hello,

i putted in php.ini file :

display_errors = Off

now, i have no error on the screen....it is not the best solution....

so when i have a php error i would like to redirect to an error page : 
"PHP SYSTEM ERROR"

Can you help me ?

Thks,
Alain

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error page

Posted by "oxfordmusic.net" <li...@oxfordmusic.net>.
>>so when i have a php error i would like to redirect to an error page :
>>"PHP SYSTEM ERROR"
>>
> Doing this would be like saying: "Hey, look, my script is lame and made a 
> boo boo!".
>
> Not a problem, i want to do it !!!!
>

sounds like you need to build a custom error handler in PHP. there are 
plenty of tutorials/resources on the web to help you...

andy 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error page

Posted by "asiani@wanadoo.fr" <as...@wanadoo.fr>.
>
>
>so when i have a php error i would like to redirect to an error page :
>"PHP SYSTEM ERROR"
>  
>
Doing this would be like saying: "Hey, look, my script is lame and made a boo 
boo!".

Not a problem, i want to do it !!!!

thks,
Alain




Eimantas Vaiciunas wrote:

>On Wednesday 06 October 2004 06:36, asiani@wanadoo.fr wrote:
>  
>
>>now, i have no error on the screen....it is not the best solution....
>>    
>>
>I think you still have errors logged in your apache error_log file.
>
>  
>
>>so when i have a php error i would like to redirect to an error page :
>>"PHP SYSTEM ERROR"
>>    
>>
>Doing this would be like saying: "Hey, look, my script is lame and made a boo 
>boo!".
>-----
>Eimis
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>  
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error page

Posted by Eimantas Vaiciunas <ei...@sc.vu.lt>.
On Wednesday 06 October 2004 06:36, asiani@wanadoo.fr wrote:
> now, i have no error on the screen....it is not the best solution....
I think you still have errors logged in your apache error_log file.

> so when i have a php error i would like to redirect to an error page :
> "PHP SYSTEM ERROR"
Doing this would be like saying: "Hey, look, my script is lame and made a boo 
boo!".
-----
Eimis

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error page

Posted by Mark McCulligh <mm...@visualtech.ca>.
Robert Andersson wrote:

> asiani@wanadoo.fr wrote:
>
>> so when i have a php error i would like to redirect to an error page 
>> : "PHP SYSTEM ERROR"
>
>
> You cannot make Apache do this. Apache have no control over the 
> request anymore after PHP started parsing it, so any solution would be 
> in PHP. However, it is unlikely that it can be done anyway.
>
> Regards,
> Robert Andersson
>
You need to write a PHP Error Handler Function and add it to every php 
page.  When an error happens on the page your custom function is 
called.  In this function you can do anything you want. Print a nice 
looking custom error message. Maybe Email the webmaster about the error. 
Or do a redirect to another page.  The problem with the redirect would 
be if the php code that fails it after the header info has been created 
you can't use the "location" function in php to do your redirect.

But if you do create a custom error handler function you will have to 
include this function on php page. You can't tell php to do it for you. 
But with the new php 5 there is some new error handling stuff that may 
work but I have not played with php 5 to much yet.

Mark.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error page

Posted by Robert Andersson <ro...@profundis.nu>.
asiani@wanadoo.fr wrote:
> so when i have a php error i would like to redirect to an error page : 
> "PHP SYSTEM ERROR"

You cannot make Apache do this. Apache have no control over the request 
anymore after PHP started parsing it, so any solution would be in PHP. 
However, it is unlikely that it can be done anyway.

Regards,
Robert Andersson 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org