jonshutt Posted September 6, 2007 Share Posted September 6, 2007 Hi folks, Just been looking at hosting with 'steamline net hosting', and testing some PHP scripts They have the 'display_errors' setting to 'OFF' in their ini setting. http://nld.streamlinenettrial.co.uk/info.php The problem is that if i'm testing scripts, I don't get any of the useful feedback letting me know where the error is etc, I just get a completely blank screen. I've tried various ways of turning it on including: ini_set('display_errors', 1); error_reporting(E_ERROR | E_WARNING | E_PARSE); but the problem seems to be a bit of a paradox: If I have an error in the page, the fail doesn't run, and the line telling it to show errors doesn't run, and I end up getting nowhere! Is there any successful way around this problem? or is it just a question of finding a different host? I've asked if they can change the settings, but they just said no, as it's shared hosting, and changing setting would affect other sites... thanks for any help jon Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 6, 2007 Share Posted September 6, 2007 ini_set('error_reporting', E_ALL); Quote Link to comment Share on other sites More sharing options...
jonshutt Posted September 6, 2007 Author Share Posted September 6, 2007 Thanks, I tried that code, but it didn't actually work. <? ini_set('error_reporting', E_ALL); print "sdsdfd"; print "sdf ?> first line should turn on error reporting, 2nd line is ok, line 3 has a mistake, which on other servers returns the error 'Parse error: parse error, unexpected $ in /usr/local/psa/home/vhosts/invernessmc.com/httpdocs/test.php on line 3' but in this case, it just gives me a blank page. Am I going about this the wrong way, or is there a problem with the host's settings? Quote Link to comment Share on other sites More sharing options...
jonshutt Posted September 6, 2007 Author Share Posted September 6, 2007 Ok, it seems to work when I have errors such as '$a = 1/0', which are mathematical kind of errors. But it doesn't work when I structural errors, such as when I make mistakes such as leaving a bracket off a line. eg "$a = ((4+5);" I think I'm looking at Parse Error issues here... i find these really useful when writing code... Quote Link to comment Share on other sites More sharing options...
xyn Posted September 6, 2007 Share Posted September 6, 2007 i would do ini_set('error_reposrting', E_ALL ~E_NOTICE); this ignores NOTICE: undefined $var meaning if you have not defined a variable but use one on your page you either use @ to silence it ie: @$_GET['var']; or you turn off E_NOTICE Quote Link to comment Share on other sites More sharing options...
jitesh Posted September 6, 2007 Share Posted September 6, 2007 For This you must have to set display_error = On in php.ini and set error_reporting = E_ALL and for others set like this ;error_reporting = E_ALL & E_NOTICE ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ;error_reporting = E_ALL & E_NOTICE ; display all errors, warnings and notices i mean to say only one "error_reporting" should have to enable. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 6, 2007 Share Posted September 6, 2007 error_reporting should be able to be set in your code - if its not working try uploading a file called php.ini to the directory this script is in and have error_reporting set to something that will show the errors you need (table of values which can be version specific can be found here) alternatively have a look at error_reporting(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.