PHP Default Errors- How do I avoid showing these errors?
Posted: Sun Sep 03, 2006 2:34 pm
Hey PHP Devs,
This is one of the most recent errors I've come across:
Warning: copy(images/6.jpg) [function.copy]: failed to create stream: Permission denied in c:\websites\nickyscott120\nickyscott.com\cpanel\cpanel.php on line 19
An earlier error was about not being able to connect to my MySQL database.
Anyway, these problems of course were fixed. Now when these types of errors occur the result is white blank page with the exception of the ""Warning: copy....failed to create stream: c:..\cpanel.php on LINE 19."" message.
How do i prevent this default php error page from showing up and echo a custom error page.
Right Now I have something like this:
Thanks in advance, Daniel M.
This is one of the most recent errors I've come across:
Warning: copy(images/6.jpg) [function.copy]: failed to create stream: Permission denied in c:\websites\nickyscott120\nickyscott.com\cpanel\cpanel.php on line 19
An earlier error was about not being able to connect to my MySQL database.
Anyway, these problems of course were fixed. Now when these types of errors occur the result is white blank page with the exception of the ""Warning: copy....failed to create stream: c:..\cpanel.php on LINE 19."" message.
How do i prevent this default php error page from showing up and echo a custom error page.
Right Now I have something like this:
Code: Select all
$link = mysql_connect( $server, $loginame, $loginpass );
if( $link ){
// do something;
}else{
// $errors[] = 'Could not connect to host.';
}