Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2005, 11:02 AM
MarcieZoob's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2004
Location: Michigan, USA
Posts: 1,019
MarcieZoob RepRank 2
Default 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!
__________________
Marcie Wolf
AlphaGeek Web Design | MarcieWolf.com
Reply With Quote
  #2 (permalink)  
Old 07-16-2005, 12:09 PM
mushroom's Avatar
WebProWorld Veteran
 

Join Date: Feb 2004
Location: Queen Charlotte B. C. Canada
Posts: 351
mushroom RepRank 0
Default

Quote:
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.oldslides.com
Reply With Quote
  #3 (permalink)  
Old 07-16-2005, 12:15 PM
MarcieZoob's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2004
Location: Michigan, USA
Posts: 1,019
MarcieZoob RepRank 2
Default

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.
__________________
Marcie Wolf
AlphaGeek Web Design | MarcieWolf.com
Reply With Quote
  #4 (permalink)  
Old 07-16-2005, 12:40 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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?
Reply With Quote
  #5 (permalink)  
Old 07-16-2005, 12:47 PM
MarcieZoob's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2004
Location: Michigan, USA
Posts: 1,019
MarcieZoob RepRank 2
Default

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.
__________________
Marcie Wolf
AlphaGeek Web Design | MarcieWolf.com
Reply With Quote
  #6 (permalink)  
Old 07-16-2005, 03:08 PM
ADAM Web Design's Avatar
WebProWorld 1,000+ Club
 

Join Date: Dec 2003
Location: Toronto, Ontario, Canada
Posts: 2,217
ADAM Web Design RepRank 0
Default

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.
Reply With Quote
  #7 (permalink)  
Old 07-17-2005, 07:02 AM
MarcieZoob's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2004
Location: Michigan, USA
Posts: 1,019
MarcieZoob RepRank 2
Default

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....
__________________
Marcie Wolf
AlphaGeek Web Design | MarcieWolf.com
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0