syntax errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samatair
    New Member
    • Nov 2007
    • 61

    syntax errors

    Hi All,
    I am working in an old website developed many years ago using PHP.
    My job is to add some features and additions and bug fixing.

    So far it's fine. Now the website faces the problem of
    500 Internal error.

    I had reported to the hosting company.
    They said when they checked the site it's working fine.
    and also suggested to check the "File Permissions" and look for any syntax errors.

    I had checked with the file permissions and it's all set right.

    And for syntax errors, directly I don't get a syntax error.
    But when I use error_reporting to On, I receive notices and warnings.

    one example is
    Code:
    $_POST[username]
    I know below is the right way to use it
    Code:
    $_POST['username']
    Does this might be the cause for the Internal Error?
    or this should not be the problem.

    Please move my thread to other section if this is not appropriate section.

    Thanks so much...
  • xaxis
    New Member
    • Feb 2009
    • 15

    #2
    HTTP Error 500 is kind of a catch-all error. It may or may not have anything to do with your PHP script. Do you have access to your webservers log files? Those would be extremely helpful in debugging this issue.
    If I were you I would set error_reporting () to E_ALL and work with your code until you're not even producing a mild warning so you can rule the code out as the culprit. If you get to this point you can be pretty sure that a server configuration issue the problem, be it httpd.conf, php.ini, or what have you.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      I used to get 500's all the time when I was using .htaccess files. A syntax error in them will throw a 500 I believe.

      Also, I don't think an undefined constant error would throw a 500.

      Comment

      • samatair
        New Member
        • Nov 2007
        • 61

        #4
        Originally posted by xaxis
        HTTP Error 500 is kind of a catch-all error. It may or may not have anything to do with your PHP script. Do you have access to your webservers log files? Those would be extremely helpful in debugging this issue.
        If I were you I would set error_reporting () to E_ALL and work with your code until you're not even producing a mild warning so you can rule the code out as the culprit. If you get to this point you can be pretty sure that a server configuration issue the problem, be it httpd.conf, php.ini, or what have you.
        Thank you Xaxis, I had followed the same thing, set the Error Reporting and cleared out all the warning and notices. But still I got the HTTP Error 500. So I had asked for the Server Error Logs from my hosting provider and waiting for their reply.

        Thanks once again!

        Comment

        Working...