Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Elmacik - huhtikuu 18, 2007, 06:46:00 AP

Otsikko: PHP doesnt report errors!
Kirjoitti: Elmacik - huhtikuu 18, 2007, 06:46:00 AP
PHP 5.2.1 is installed.
And error reporting is on in php.ini
And also I have error_reporting(E_ALL); in my file.
My file consists of these kind of codes:


<?php
error_reporting(E_ALL);
include_once('Settings.php'); // A file that has variables defined only.
include_once('Functions.php'); // A file functions defined only.

function($parameter); // A function which is placed in the file above

echo 'Some other text that should be printed to screen';
?>


Result is an empty page... I screw the codes in Functions.php especially, but still white page. If I correct the codes, the page displays correctly. But I screw it up, PHP doesn't report what the error is.. Just a blank page..

Any ideas?
Otsikko: Re: PHP doesnt report errors!
Kirjoitti: motumbo - huhtikuu 22, 2007, 02:27:15 AP
I see this post is a few days old.  I don't know if you have an answer yet.

Is the page being output (the HTML) completely blank?  I can only guess at what the problem could be.  Here are my guesses:

1) Your host or development server has error reporting turned off at a global level.
2) You have a "die" statement somewhere that is terminating the code.
3)  I had a #3, but I am very tired and cannot remember it.  :P

When I have a problem, what I do is go into my code and put an echo statement with the text "Made it to here!".  Then, I know where my code is making it to.  Then I advance until I find the place where the error is occuring.

Works every time.
Otsikko: Re: PHP doesnt report errors!
Kirjoitti: Elmacik - huhtikuu 24, 2007, 02:38:54 AP
Yes you must have been very tired when writing this post :P
Because I see that you havent read my post above carefully ;)
Because I said, error reporting is on.
The server is local. And the codes are completely written by me.
So I know there is no die or exit statement somewhere in the codes.

I just screw the codes but PHP doesnt give any error.
For example I put this into the file:
function ($parameter) echo 'something'otherthing'something' function();
Guess, no errors.. Just a blank page. (Copmletely blank, no headers are sent.)