Php page produces no Error messages!

Hello,

Our Php pages on a new server that we have moved on are producing NO Erroe messages!
Worse still even if I add a, for debugging:
echo ‘Hello World 0<p>’;
it does not even print that out.
That is the page loads with completely nothing in it. But a digit 1 on the upper left corner!
How do we tell the Php on this news server to output error messages?

Thank you.

Check out php_info()

E.G.

<?php

// Show all information, defaults to INFO_ALL
phpinfo();
?>

Create a file, upload it and run it - if PHP is active, it will display current config

Have you followed the instructions in Common-PHP-Problems?

Hello,

Yes, I did that.
So what are we looking for?
What should we be changing to display Error messages to the browser as they occur?

ThanX,

Hi,

I also added the code:

ini_set(‘display_errors’,1);
error_reporting(E_ALL);

just to see. But the Php page still comes back totally Blank!

Really amazing how strange stuff can pop up on a new server!

2ndmouse,

Just to let you know I did a test but just removing a ; from a line of a Php page and the whole page
is displayed blank without any Error messages.
So the problem is for sure with the Php.ini of the new server that results in it displaying no Php Error
messages but displays a blank page.

Even if you add this code:

ini_set(‘display_errors’,1);
error_reporting(E_ALL)

it still prints no Php Error messages! Which is death when it comes to Php programming :frowning:

So do you all know which Php.ini setting we need to change to enable Php error messages to be displayed?

ThanX.

Can you copy and paste your script inside and supply a link to the offending page.

It is any page that has any error in it, shows up totally blank.
That is as I said I took a Php page that is working fine, and just removed a ; from one of the lines, and then
it shows up as Blank too.

2ndmouse,

So you have any ideas as to what we need to do to enable Php Error reporting on our new sever?

Again, a Php page with any error, will display as a totally Blank page rather than reporting the Error in that page.
And I mean any Error, as simple as leaving off a ; or whatever results in a totally Blank page being returned by the server.

BTW, I did enable this in Php.ini

display_errors = stdout

and also added all these commands to a given Php page:

ini_set(‘display_errors’,1);
ini_set(‘display_startup_errors’,1);
error_reporting(-1);

To no result :frowning:

Thank you all.
I am at wits end here :frowning:

Did you remember to restart the server after making the changes to phi.ini ?

I have had this error with CodeIgniter and had to use echo LINE; die; to trace the flow and chase the errors.

Check the php_error log file, it should have lots of entries :slight_smile:

What version of PHP are you using (what is reported by each “level” of error reporting varies a bit between versions of php

SpacePhoenix,

Yes, I did re-start Apache after the change to the Php.ini file.

And it is PHP Version 5.3.3

But again it is NOT reporting any Error at all.
Even the simplest Errors are causing a Blank page to be returned!!!
So there is something strange (wrong) somewhere that is causing on this NEW server all of a
sudden Php pages to come back Blank when any error occurs!

So what to do?

Try inserting this on the page that you are calling:



<?php 
  echo "Hello World";  die;


If that works then I think you have a syntax error on the page and you will have to step through until you find the syntax error.

Best to do it by moving the die; halfway down the page:

  1. if does not work work then move the die; halfway up

  2. if does work work then move the die; halfway down again

  3. repeat until you find the syntax error

Try swapping around the order of them two lines

SpacePhoenix, I swapped the 2 lines, that is now have at the top of the Page:

error_reporting(E_ALL);
ini_set(‘display_errors’,1);

And still nothing. That is again page comes back totally blank!
Amazing :frowning:
You would thing something this basic and essential that is error reporting on a Php page would not take
4 days to enable :frowning:

As it stands what are the current values for the following when you view the output of phpinfo()

  • display_errors
  • error_reporting

[QUOTE]error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR);/QUOTE]

That’s what I personally use for setting the error reporting

Hi,

Just wanted to let you know that I finally resolved this.
The problem was due to
error_reporting
appearing TWICE in Php.ini file.
So the 2nd instance value was over riding the 1st instance which I had updated!

[QUOTE=SpacePhoenix;5317276]As it stands what are the current values for the following when you view the output of phpinfo()

  • display_errors
  • error_reporting

error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR);/QUOTE]

That’s what I personally use for setting the error reporting