Re: Shouldn't script errors show in my browser?
| From: | David Otton | Date: | Fri, 17 Oct 2003 15:43:57 +0000 |
| Subject: | Re: Shouldn't script errors show in my browser? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166480@lists.php.net to get a copy of this message | ||
On Fri, 17 Oct 2003 11:29:41 -0400, you wrote:
>I hope this question is not too stupid! When I have an error in my script,
>it seems to me that the web server, or in my case the php CGI module I am
>using for testing, should send something back to my browser displaying an
>error message. Instead, I can write any garbage I would like in my php
>script and the browser just shows me a blank page. Is this because I am
>running php as a CGI module?
Try cranking your error reporting level up in php.ini
http://uk2.php.net/manual/en/ref.errorfunc.php#ini.error-reporting
Check the display_errors directive while you're at it. Don't forget to
restart the webserver.
Also, sometimes errors don't show because they're embedded in HTML.
Eg
<font face="<? echo($fake_variable); ?>">
would return
<font face="<br /><b>Notice</b>: Undefined variable: fake_variable in
<b>file.php</b> on line <b>1</b><br />">
And you'll have to examine the un-parsed HTML to find the error.