php fatal errors are not showing up

Red Squirrel

[H]F Junkie
Joined
Nov 29, 2009
Messages
9,211
I just spent several hours pulling my hair out trying to get one of my old forums to work that randomly stopped working. It's very old, IPB 2.0. It just shows a blank page, with nothing. I have error reporting on, if I make a syntax error or something it will show an error.

However for whatever reason it's not showing all errors. There is this fatal error in an include file (Call-time pass-by-reference has been removed) but that error does not show up, instead it just shows a blank page.

To add to my frustrations, when I was putting echo's in the include file they were not even showing up, but the echo in the previous file before the require showed up. But I guess the fatal error just stopped the whole execution of that file, but I did not even know there was a fatal error till I tried to access that file directly. Why is it doing this? Is there a way I can make sure that these type of errors actually show up? This is kind of important when trying to code stuff or fix code. I have error reporting set to all on the server.
 
Does a regular php function even work in your setup?

Code:
<?php

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

?>
 
Yep works fine. I have tons of php stuff on this server that works fine, it's a dev server. Basically I'm just trying to get an old forum to work. (been down for months after a php update, it was neglected and very old and basically just took it down wanting to merge with a newer forum) There's some changes done to php in which broke the forum, but instead of actually showing errors it does nothing. I even tried to put this at the start of the index.php:

Code:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

I have the equivalent setup in php.ini, except there I skip notice. The odd part is that the fatal error only shows up if I try to access the file directly. If it's in an include it just makes a blank page.

Edit: Just realized I wanted to post this in the programming forum, I guess it sorta works here too.
 
Last edited:
I don't want to downgrade nor know how to as it's installed with apt-get which just installs the latest version. I don't want to mess with installing from source then I'll have multiple versions and it will be a general screw up.

I need to fix the actual php code, but I just need the errors to actually show up properly so I know where to look.
 
I don't want to downgrade nor know how to as it's installed with apt-get which just installs the latest version. I don't want to mess with installing from source then I'll have multiple versions and it will be a general screw up.

I need to fix the actual php code, but I just need the errors to actually show up properly so I know where to look.

Thats going to be one hell of a project. If it does turn out to be a problem with the version of PHP that you are using, you may want to look into running a control panel like Webmin that makes it really easy to have multiple versions of PHP running, and to assign a version to one site.

What is your hosting environment? Was this working before and then an update broke it, or are you starting from an entirely unknown position?
 
If you're on FreeBSD use jails, on Linux OpenVZ is similar but you can also use a real virtual machine.
//Danne
 
Thats going to be one hell of a project. If it does turn out to be a problem with the version of PHP that you are using, you may want to look into running a control panel like Webmin that makes it really easy to have multiple versions of PHP running, and to assign a version to one site.

What is your hosting environment? Was this working before and then an update broke it, or are you starting from an entirely unknown position?

Basically the site was online and it broke, so it was probably a recent php update.

The dev server was also remade at one point as I wanted to organize things better so of course it got a new version too. All I want to do is be able to see ALL php errors, that is more important right now than getting the site to work, as I just want to see if I even can get it to work without any major changes, but it will be getting converted to a new forum anyway.

So right now I just want all php errors to actually show up. This is important for a dev server as if something does not work I need to know why. In php.ini I have:

error_reporting = E_ALL & ~E_NOTICE

I've also tried just E_ALL but those fatal errors still don't show up. The weird part with that is it basically ignores the include file too, so if I rename the file that has the error it still just displays a blank page, not even an error that it can't find the file.
 
If you're on FreeBSD use jails, on Linux OpenVZ is similar but you can also use a real virtual machine.
//Danne

This actually IS a VM.

Anyway I just just figured it out, turns out that particular forum script was actually overriding the error reporting. I never thought of checking for that because the fatal error was happening before the rest of the code so did not figure that the rest of the code would be relevant to the situation until I get there. I guess the php interpretter still reads the whole script and executes it but just does not display anything if an earlier error occurred in an include file.

I removed that line and now I can actually see errors. So I'll just have to keep this in mind when working on other projects as well.
 
Back
Top