brianlange Posted May 22, 2012 Share Posted May 22, 2012 Should PHP warnings cause http 500 errors? I was under the impression that only a fatal error would cause a 500 error? I am troubleshooting a max_input_vars warning that may be the cause of a 500 error. Quote Link to comment https://forums.phpfreaks.com/topic/262935-should-php-warnings-cause-500-errors/ Share on other sites More sharing options...
scootstah Posted May 22, 2012 Share Posted May 22, 2012 No PHP errors cause HTTP 500, they all send HTTP 200. Quote Link to comment https://forums.phpfreaks.com/topic/262935-should-php-warnings-cause-500-errors/#findComment-1347665 Share on other sites More sharing options...
Andy-H Posted May 22, 2012 Share Posted May 22, 2012 I don't know why but my employers servers send 500 errors when there's an error in my scripts, I can over-ride this with ini_set('display_errors', 'on'); error_reporting(E_ALL | E_STRICT); Quote Link to comment https://forums.phpfreaks.com/topic/262935-should-php-warnings-cause-500-errors/#findComment-1347698 Share on other sites More sharing options...
scootstah Posted May 22, 2012 Share Posted May 22, 2012 I don't know why but my employers servers send 500 errors when there's an error in my scripts You can achieve this functionality by catching errors in error handlers, but I don't know of any other way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/262935-should-php-warnings-cause-500-errors/#findComment-1347820 Share on other sites More sharing options...
kicken Posted May 22, 2012 Share Posted May 22, 2012 IIS will throw 500 errors rather than displaying the error under certain fastcgi configurations. The servers where I work do that. We just have to check the error log file whenever we see a 500 error to see what the error message is. It's a bit annoying but doesn't come up that often on those servers as most errors are caught on my dev environment which uses apache+mod php and displays them fine. Quote Link to comment https://forums.phpfreaks.com/topic/262935-should-php-warnings-cause-500-errors/#findComment-1347829 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.