SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast St. Anger's Avatar
    Join Date
    Nov 2003
    Location
    R'lyeh
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    500 Internal Server Error when retrieving more than 346 rows

    Hello,

    I'm hoping someone could please help me determine the cause of this error:

    Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    If you think this is a server error, please contact the webmaster.

    Error 500

    Mon Oct 12 22:09:43 2009
    Apache/2.0
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    It happens whenever I try to retrieve more than 346 rows from the database using PHP--doesn't happen when there are less rows, and if I add a LIMIT for less than 346 rows it works perfectly. This makes me think it may be some sort of PHP/MySQL memory issue, but I really don't know anything about that kind of thing. I know 500 errors are usually the result of bad file permissions, but I've checked every file--they are all 755, as they should be. Also, I've used this same script on multiple servers/websites and never had this problem occur before, but the web host (1blu.de, a German hosting provider) is saying there's nothing wrong with their server and it's the script that has a problem.

    Unfortunately, I cannot provide a link to the page because it's a password protected page.

    Thanks for any help! If there is anymore useful information I could provide please let me know.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http error 500 can mean almost anything, not only issue with file system permission
    most probably you have issue with memory or execution time of sql query

    so when your php reads 346 rows it eats enough memory to be killed.
    I think you can try to eat memory by more simple script without sql and check if 500 appears

  3. #3
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,000
    Mentioned
    101 Post(s)
    Tagged
    0 Thread(s)
    Have you tried to retrieve the same 346 rows via phpmyadmin? If you can get the rows via phpmyadmin then would point to the script being used.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  4. #4
    SitePoint Enthusiast St. Anger's Avatar
    Join Date
    Nov 2003
    Location
    R'lyeh
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    Have you tried to retrieve the same 346 rows via phpmyadmin? If you can get the rows via phpmyadmin then would point to the script being used.
    Yes, and it worked in phpMyAdmin.

    Hmm...I will take a look at the script. It's always worked before though, so it's strange.

  5. #5
    SitePoint Enthusiast St. Anger's Avatar
    Join Date
    Nov 2003
    Location
    R'lyeh
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After taking a look at the code and commenting things out I still think it may be a PHP/server memory issue. Retrieving everything from the database actually works fine, so I guess this is not a MySQL problem after all. After the information is retrieved, the script creates a multi-dimensional array out of that data using a while loop, and that's when the 500 error pops up, after handling 346 rows/elements.


Bookmarks

Posting Permissions

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