500 Internal Server Error

Discussion in 'PHP' started by dotcompals, Aug 17, 2006.

  1. #1
    Hello, It us seen that some times, while installing some php script the server returns "500 Internal Server Error". How to avoid getting this error.?

    What is the default htacess file to get rid of the above error?
     
    dotcompals, Aug 17, 2006 IP
  2. petronel

    petronel Peon

    Messages:
    113
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i coold be.
    you can look for clues on apache error_log
     
    petronel, Aug 17, 2006 IP
  3. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The only fix is to fix the script. This is not a client-side problem. You need to track down the error in your logs and resolve it.

    When I am installing new PHP scripts, I always run them from the command line first. If you can access an SSH shell on your host machine connect through that and navigate to the directory in which the script is located. Then run the command:

    php myscript.php

    If it chokes, you will see errors on the screen. Fix them. Once the screen version runs correctly, try accessing it through the web.

    Also, you can try putting something like this at the beginning of the new script. This allows you to redirect all errors to a specific file to help you track down errors in the script and fix them:

    error_reporting(E_ALL & ~E_NOTICE);
    ini_set("display_errors", "off");
    ini_set("log_errors", "on");
    ini_set("error_log", "/home/MY-HOME/php_errors");
     
    clancey, Aug 17, 2006 IP
  4. jroxonline

    jroxonline Peon

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've had this issue before. What happened was our host didn't support the php_flag directive in .htaccess.

    We had to disable those to get the php scripts running again.
     
    jroxonline, Aug 18, 2006 IP
  5. ZoomCities

    ZoomCities Well-Known Member

    Messages:
    1,357
    Likes Received:
    156
    Best Answers:
    0
    Trophy Points:
    185
    #5
    Try upgrading your PHP to a newer version..

    Zac
     
    ZoomCities, Aug 18, 2006 IP
  6. dotcompals

    dotcompals Prominent Member

    Messages:
    2,905
    Likes Received:
    254
    Best Answers:
    0
    Trophy Points:
    320
    #6
    Thanks for help DP friends. Iresolved this issue by changing some file permissions. thanks.
     
    dotcompals, Aug 18, 2006 IP
  7. yellowindian

    yellowindian Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    check mod rewrite

    enable if its closed
    many scripts need that on
     
    yellowindian, Aug 20, 2006 IP