www.webdeveloper.com
Results 1 to 9 of 9

Thread: Replaced php and get HTTP 500 internel server error

  1. #1
    Join Date
    Feb 2005
    Posts
    35

    Replaced php and get HTTP 500 internel server error

    I replaced a working file, with the same file from another working web site, but the new file generates a HTTP 500 internal server error page.



    The only difference in the new page are these lines:

    Code:
    ///////////////////////////////////////////////////
    $_SESSION['searched'] = $_GET['keyword'];
    $prch = $_GET['p'];
    if ($user_id == "") {
    $new_temp = "themes/$user_theme/search_results1.htm";
    }elseif ($prch == "1") {
    $new_temp = "themes/$user_theme/search_results2.htm";
    }else{
    $new_temp = "themes/$user_theme/search_results.htm";
    }
    I'd like to learn the reason why these lines might be creating this error.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,248
    Anything in the PHP error log?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2005
    Posts
    35
    Quote Originally Posted by NogDog View Post
    Anything in the PHP error log?


    I see no changes in the error_log file, last entry was 05/21/13.
    Any additional help will be apprecaited

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,248
    Next thing I'd look at is the HTTP logs, then maybe try turning up the PHP error_reporting level to E_ALL if it's not already there.

    Also, sometimes weird things happen if you copy-paste code in terms of non-printing unicode or other non-ASCII characters getting picked up by the copy, so you might want to re-edit the file in your text-only editor of choice.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Feb 2005
    Posts
    35

    Thanks

    Thanks for your reply. Much appreciated.
    I don't know where the http logs are.
    In public_html, the folder Logs has convertor.log.txt, logfile.rtf and search_log.txt, none of which show anything regarding an error today.
    Also the error_log file shows nothing since 05-21-13. All these files are CHMOD'd at 777.
    I don't know what E_ALL is.
    Additionally, I idn't copy and paste, I simply replaced search.php with search.php from another working site.
    Any additional help will be appreciated.
    Thanks again.

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,248
    Try sticking this at the top of the PHP file:
    PHP Code:
    <?php
    error_reporting
    (E_ALL);
    However, if the problem is a parse/compile error of some sort, that won't get triggered, in which case you would need to set it in either your php.ini config file or in .htaccess (via a php_value command).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  7. #7
    Join Date
    Feb 2005
    Posts
    35
    Thanks for that help.
    Just for my education, if I add that E_ALL code "to the top of the PHP code", what will it do?

  8. #8
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,248
    PHP will log all errors, warnings, and notices (or, if you have the display_errors setting turned on, it will display them in the output).

    See http://www.php.net/manual/en/functio...-reporting.php
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  9. #9
    Join Date
    May 2013
    Location
    India
    Posts
    11
    500 Internal Server Error is an Server level apache error, and you will need to ask your Host what the exact problem is..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles