Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger_error() working differently on Linux

Status
Not open for further replies.

csbdeady

Programmer
Joined
May 18, 2002
Messages
119
Location
GB
Hi there

Here's a puzzle..

On Win2k with PHP 4.3.4 and Apache 2.0.48 if I have:

Code:
echo "some text<br />";
trigger_error();

and then perform the error handling to output my custom error I get:

some text
my error text

But if I do the same thing on RedHat Linux with PHP 4.3.5 and Apache 2.0.48 the output is just:

my error text

I do not get "some text" output.

I've looked at php.net's info on trigger_error() but cannot see anything that jumps out of me that says "gotcha".

Has anyone seen something like this or could give me a hint as to where I should look for the cause of this?

Ta as always!
-Colin
 
I should also state that if I comment out trigger_error() then "some text" is output correctly on the Linux box.
 
ahah! After puzzling on this for several more hours I suddenly realised that my error handler has ob_end_clean() in it. It appears that on Windows (for some unknown reason) this isn't clearing out the output buffer - but on Linux it is (anyone know why?)

Replacing ob_end_clean() with ob_end_flush() appears to have fixed this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top