PHP 5 Not Showing Errors

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

icesolid
Forum Regular
Posts: 502
Joined: Mon May 06, 2002 9:36 pm
Location: Buffalo, NY

Post by icesolid »

This is all I have in my .htacess file:

Code: Select all

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.website.com$
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301]

ErrorDocument 404 http://www.website.com/error.php
The first three lines are used to redirect any website.com requests to http://www.website.com. Nothing that should effect PHP error reporting. I have infact tried removing everything from the .htaccess file and error reporting still does not work.

My whole problem is that everything worked fine until I upgraded to PHP 5.2.2. This is really starting to get to me becasue I can not find anyway that PHP should NOT be showing me my errors. It used to work.

I have tried re-installing PHP, shutting down the server and rebotting and double checking my php.ini file.

Still no success.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

In order to have parse errors printed to the client you have to enable display_startup_errors before the script is parsed (e.g. in the php.ini).

But that doesn't explain why error_reporting appears to be set to 0 although phpinfo() says otherwise.
icesolid
Forum Regular
Posts: 502
Joined: Mon May 06, 2002 9:36 pm
Location: Buffalo, NY

Post by icesolid »

I have turned display_startup_errors and it is still not displaying my errors.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

and next try ...

Code: Select all

<?php
foreach( array('display_errors', 'display_startup_errors','error_reporting') as $p ) {
	echo $p, '  cfg: ', get_cfg_var($p), ' ini:', ini_get($p), "<br />\n";
}
echo "<br />\n";

error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
foreach( array('display_errors', 'display_startup_errors','error_reporting') as $p ) {
	echo $p, '  cfg: ', get_cfg_var($p), ' ini:', ini_get($p), "<br />\n";
icesolid
Forum Regular
Posts: 502
Joined: Mon May 06, 2002 9:36 pm
Location: Buffalo, NY

Post by icesolid »

Thank you volka for that.

However, I told my dedicated host last night that I needed this fixed immediately (I have been trying to figure it out my self thus far, so I could learn what the issue is for future reference) and they put some guy to work going through each line of the 5.2.2 php.ini file comparing it to the old 4.3.3 php.ini file and somehow he got the problem fixed going that route. How, they didn't tell me and the guy went home. He worked on it for 2.5 hours.

Great host by the way, liquidweb.
Post Reply