kiskadee Posted December 9, 2018 Share Posted December 9, 2018 Why are my PHP scripts errors not being displayed? Instead, the server is throwing a 500 internal error. I've already tried to add the 'display_errors' php flag to .htaccess file, but it doesn't seem to work, it keeps on returning the same 500 error. My site url is: kiskadee.heliohost.org Thanks in advance for any kind of help. Quote Link to comment Share on other sites More sharing options...
Luigi123 Posted December 9, 2018 Share Posted December 9, 2018 Moved to Customer Service. Quote Link to comment Share on other sites More sharing options...
wolstech Posted December 9, 2018 Share Posted December 9, 2018 What version of php are you using? Quote Link to comment Share on other sites More sharing options...
kiskadee Posted December 9, 2018 Author Share Posted December 9, 2018 (edited) According to cPanel information, the php version I'm using is ea-php56. Edited December 9, 2018 by kiskadee Quote Link to comment Share on other sites More sharing options...
Krydos Posted December 9, 2018 Share Posted December 9, 2018 Does it work now? Quote Link to comment Share on other sites More sharing options...
kiskadee Posted December 9, 2018 Author Share Posted December 9, 2018 Yes, now it works! Thank you. Can you tell me what, exactly, was the "problem"? Quote Link to comment Share on other sites More sharing options...
Krydos Posted December 9, 2018 Share Posted December 9, 2018 PHP errors are off by default. I had to recompile a few versions of php a while back, and simply forgot to turn errors back on. Quote Link to comment Share on other sites More sharing options...
Computer Nerd Kev Posted December 10, 2018 Share Posted December 10, 2018 It sounds like it might be helpful to point out, for any users who've just discovered lots of error messages suddenly announcing themselves to the public, that error display in pages can be disabled with the "display.errors = off" setting in a .user.ini file placed in the web pages directory. Errors can be set to be written to a file using these directives:log_errors = onerror_log = "~/logs/phperrors.txt" "~/logs/phperrors.txt" could be any other directory that's convenient. "error_reporting =" can also be included to determine which errors get written/displayed (see the PHP manual for option descriptions). I also have "display_startup_errors = off", but that probably isn't now on by default. Quote Link to comment Share on other sites More sharing options...
wolstech Posted December 10, 2018 Share Posted December 10, 2018 error_reporting(0); Added to the code will also prevent their display. Our system already logs the errors to error_log in the same folder as the script, though your method should allow you to prevent the logging or change the filename or location if desired. 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.