Submit Your Article Forum Rules

Results 1 to 7 of 7

Thread: Server Error 500 on PHP/MySQL site

  1. #1
    Senior Member MarcieZoob's Avatar
    Join Date
    Jul 2004
    Posts
    912

    Server Error 500 on PHP/MySQL site

    We have a property management company we've created a web site for that uses PHP/MySQL. In the last two days the site has gone done twice and gives the "Server Error 500" when you visit the site. Our hosting provider has been able to bring the site back up for us and they provided us with some suggestions.

    Our host suggested that the problem is related to the way the site has been developed. The scripts on the site fork too many processes, which exceed the limit of the MySQL and the shell processes on the server. It seems that most of the processes are forked by the following file:

    listing_browse.php

    They stated that there were over 10 processes running for users, all launched by this file.

    They ask us to optimize the scripts on the site, as they seem to fill the entire limit allocated for this user. In such cases, the scripts will usually use any limit, so optimization is the only option.

    Since we're very new at this, can someone take a look at the site and perhaps direct us in how to optimize the scripts... or tell us how to find help in optimizing?

    http://www.grahamrentalproperties.com

    Our company is using the exact same database structure on real estate site that does rentals - the site actually gets more visits/bots than the once serving up errors - but it has never gone done like this. Thanks in advance!

  2. #2
    Senior Member mushroom's Avatar
    Join Date
    Feb 2004
    Posts
    282
    listing_browse.php
    Is a php file, and can not normally be viewed over the web.

    You will have to post it, or make it available as a text file.
    Irony: That for most people the most "trusted" web site on the planet is for a company the has been convicted of criminal activity.

    Both Security and SuSe start with "S". www.eemam.com

  3. #3
    Senior Member MarcieZoob's Avatar
    Join Date
    Jul 2004
    Posts
    912
    Thanks for the reply, I just realized that you would not be able to view the script... Duh.

    We did find a fix at a PHP forum, which my business partner is working on right now. Hopefully this will take care of our errors.

  4. #4
    Senior Member
    Join Date
    Jul 2003
    Posts
    1,739
    In addition to the 500 error, are you getting any mysql errors? It's not very common to receive a 500 error with php applications.
    Usually 500 is seen with cgi scripts, folder/file permissions and htaccess.

    It's possible that your host is running php as a cgi, which is more restrictive. Have you looked at your server logs to see if it gives you anything?
    Web Hosting Guru
    | Need Help For Your Forum?

  5. #5
    Senior Member MarcieZoob's Avatar
    Join Date
    Jul 2004
    Posts
    912
    My partner received sql errors which immediately directed us to the site. The problem we found lies in a shared temporary table in the listing_browse file; we found out how to fix this code so hopefully no more errors.

    By looking at our stats, we found three bots were indexing the site at the same exact time which caused an overload. I've since added a "crawl-delay" to our robots.txt file.

  6. #6
    Senior Member ADAM Web Design's Avatar
    Join Date
    Dec 2003
    Posts
    2,100
    I'm still getting the error at this end.

    500 Server Error
    The web server encountered an error or misconfiguration and was unable to complete your request. If this error persists, please contact the webmaster, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    The 500 Server Error is in red and the rest of it is black text on a pale yellow background (all Verdana).

    I don't know if this will help any (or if this is what I'm staring at, since the error message looks very similar to the default Apache program error message, other than the layout), but can you install custom 500 error pages on that site's server? I do it every so often, and I've configured mine to send me an email any time something goofy goes wrong.

    I use ASP, though, not PHP, so I can use the Error collection provided with it.

    Here's a sample of how mine appears:

    http://www.hibiscusflorals.com/intentionalerror.asp

    Having seen that site (and commented on the cart...thanks, by the way) before, you'll notice how it looks and feels like the rest of the site. But the message is a bit friendlier, and the user can still navigate the rest of the site.

    Here's what the email looks like from my end:

    An Error has occurred while processing /intentionalerror.asp on
    www.hibiscusflorals.com.

    Error Details:

    Page:

    www.hibiscusflorals.com/intentionalerror.asp

    Line: 36
    Description: Unterminated string constant
    Category: Microsoft VBScript compilation
    Querystring:
    SQL Query:
    Number: -2146827255
    Date: 7/16/2005
    Time: 2:59:27 PM
    Form Information

    As you can see, I've gotten almost everything I could possibly need to isolate and solve the error. The only thing I haven't quite figured out how to do yet is to do a variable dump. Form dump, no problem, but not a variable dump.

    EDIT: most of this is for the benefit of those who may not know what I'm talking about. MarcieZoob, I suspect you got the point long before I added the detail to it.

  7. #7
    Senior Member MarcieZoob's Avatar
    Join Date
    Jul 2004
    Posts
    912
    Thanks for the info, Adam. We do receive sql errors but I like the idea of the custom error page. (We have one for 404.)

    I think my partner got the scripts fixed and optimized last night so hopefully no more 500 server errors from here on out....

Similar Threads

  1. Mysql error to many connections
    By dracula in forum IT Discussion Forum
    Replies: 34
    Last Post: 08-28-2009, 07:34 AM
  2. MySQL connect error to an outside database
    By getmea in forum Database Discussion Forum
    Replies: 5
    Last Post: 07-30-2008, 05:35 AM
  3. mySQL Too Many Connections Open error
    By getmea in forum Database Discussion Forum
    Replies: 17
    Last Post: 12-19-2007, 07:56 AM
  4. 500 internal server error stops googlebot crawling my site?
    By internet-marketing-cr in forum Search Engine Optimization Forum
    Replies: 10
    Last Post: 01-18-2007, 01:57 PM
  5. Dynamic site: Tackling 500 Http Server error
    By lucks in forum Graphics & Design Discussion Forum
    Replies: 2
    Last Post: 05-13-2004, 10:03 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
  •