Jump to content


Photo

PHP errors not displaying

php error 500 internal error 500 internal

  • Please log in to reply
8 replies to this topic

#1 kiskadee

kiskadee

    Newbie

  • Members
  • 3 posts
  • Gender:Male

Posted 09 December 2018 - 06:09 PM

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.


Ego sum Kiskadee!


#2 Luigi123

Luigi123

    Rank X Member

  • Moderators
  • 1,252 posts
  • Gender:Male
  • Location:Winnipeg, Manitoba, Canada

Posted 09 December 2018 - 06:11 PM

Moved to Customer Service.

server_load_s.gifserver_load_j.gifserver_load_t.gif
server_uptime_s.gifserver_uptime_j.gifserver_uptime_t.gif

 


#3 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 9,896 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 09 December 2018 - 07:10 PM

What version of php are you using?

Please do not PM me for support. Posting on our forums lets all of us learn.

Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...


#4 kiskadee

kiskadee

    Newbie

  • Members
  • 3 posts
  • Gender:Male

Posted 09 December 2018 - 08:00 PM

According to cPanel information, the php version I'm using is ea-php56.


Edited by kiskadee, 09 December 2018 - 08:02 PM.

Ego sum Kiskadee!


#5 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 17,568 posts
  • Gender:Male

Posted 09 December 2018 - 09:09 PM

Does it work now?

#6 kiskadee

kiskadee

    Newbie

  • Members
  • 3 posts
  • Gender:Male

Posted 09 December 2018 - 09:39 PM

Yes, now it works! Thank you. Can you tell me what, exactly, was the "problem"?


Ego sum Kiskadee!


#7 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 17,568 posts
  • Gender:Male

Posted 09 December 2018 - 10:22 PM

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.

#8 Computer Nerd Kev

Computer Nerd Kev

    Rank I Member

  • Members
  • Pip
  • 22 posts
  • Gender:Male
  • Location:Australia

Posted 10 December 2018 - 03:46 AM

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 = on
error_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.



#9 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 9,896 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 10 December 2018 - 01:19 PM

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.


Please do not PM me for support. Posting on our forums lets all of us learn.

Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...






Also tagged with one or more of these keywords: php error, 500 internal error, 500, internal

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users