Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Internal 500 Error - How to show the error instead?

    I have some custom code and a custom class. The class connects to an API and has error handling. This works fine with tests outside ZenCart.

    The issue is, ZenCart seems to supress these errors and instead shows an Internal 500 error, instead of logging / displaying the error.

    Where could I change this to show errors / at least ignore the errors?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Internal 500 Error - How to show the error instead?

    Quote Originally Posted by joecooper View Post
    I have some custom code and a custom class. The class connects to an API and has error handling. This works fine with tests outside ZenCart.

    The issue is, ZenCart seems to supress these errors and instead shows an Internal 500 error, instead of logging / displaying the error.

    Where could I change this to show errors / at least ignore the errors?
    ZC is not "handling" a 500 error, that really is coming from your server... There is something incorrect that is generating the 500 error. Information about the error should be in the server logs.
    Don't know of a way other than to fix the errors to ignore them entirely... I have seen message suppression applied by prepending the offending command with @ but that's the most I've really seen/needed..
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Internal 500 Error - How to show the error instead?

    If your code is running in a "standard" Zen Cart environment, i.e. post-application_top.php, then the error handling setup should result in debug-logs being generated for those server-500 errors (most of them, anyway). It's possible that the API you're using is somehow mucking with those PHP logging settings so that you're not getting the logs you need to correct the issue you're facing.

  4. #4
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Re: Internal 500 Error - How to show the error instead?

    The code runs fine and works outside of Zen Cart. The class I am using has exception handling so that errors will display. However, within the Zen Cart environment, these are not displaying, and zen cart seems to suppress this in terms of a 500 error. The error log doesn't show anything on the error.

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Internal 500 Error - How to show the error instead?

    Quote Originally Posted by joecooper View Post
    However, within the Zen Cart environment, these are not displaying, and zen cart seems to suppress this in terms of a 500 error. The error log doesn't show anything on the error.
    ZenCart isn't suppressing the error messages, and the Zencart error logs won't give any info about '500' errors.

    The reason is simple. The '500' errors are generally clearly indicated as being a SERVER error. This means things are 'dying' before ZenCart/PHP even gets a look in.

    Server errors are distinct from PHP errors, where the *server* is working perfectly, but the fault is with the PHP code itself.

    Knowing/understanding this is quite important. SERVER errors are generally the result of

    1) File or Folder Permissions (Too strict, or too relaxed)
    2) Mod_security rules being triggered
    3) Something amiss with the server configuration itself.

    I can't offhand think of any PHP (or other) coding issue that will cause a SERVER error. Of these 3 possibilities, the only one that the user can 'fix' is the file/folder permissions. The others will need help from the hosting provider to resolve.

    On the other hand, PHP and/or other *coding* errors are rarely ever going to be the cause a server to 'die' in such a way that the cause won't show up in the ZenCart (and/or other) error logs.

    What I'm trying to impart to you here is that whatever the cause of the problem, you are not likely to find the fault with your actual code. Your best course of action would be to first check the the file/folder permissions, and if they seem ok, contact your host. They will have access to the log file that will detail *exactly* what and where the problem is, and they will *probably* even have to fix it for you when identified anyway.

    If unsure about file folder permissions. Files should be '664', Folders should be '775'

    There are often recommended exceptions to these values, but in my experience I don't recall ever coming across a situation or server where these values would cause a problem due to being either too relaxed or too restrictive at least from the *server* perspective.

    If/when I come across a site with a problem that looks like it may be permissions related, those are the defaults I set to get things functional again, and then I'll tweak those that need something different by the given application.. eg: Zencart config files will need '444' (or similar)


    Hope this helps put you on track.

    Cheers
    RodG

 

 

Similar Threads

  1. v153 Internal 500 Error - How to show the error instead?
    By joecooper in forum General Questions
    Replies: 1
    Last Post: 6 Nov 2015, 10:28 AM
  2. v154 Having the worst time installing ZC (old PHP version) Error 500-Internal Server Error
    By pegburke4 in forum Installing on a Linux/Unix Server
    Replies: 9
    Last Post: 8 Oct 2015, 06:54 AM
  3. v150 Display 404 error page instead of 500 Internal Server Error
    By ShopVille in forum General Questions
    Replies: 1
    Last Post: 7 Dec 2012, 05:34 PM
  4. v139f Shopping Cart error: HTTP Error 500 (Internal Server Error)
    By Tulameen in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2012, 01:48 AM
  5. error/cannot access The Admin Console 500 internal server error
    By psarapas in forum Installing on a Mac Server
    Replies: 4
    Last Post: 12 Mar 2008, 11:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg