You are here:  » Internal Server Error when viewing the site


Internal Server Error when viewing the site

Submitted by robah on Thu, 2013-09-26 01:35 in

Hi

I've tried searching in the forum and can find posts about people experiencing 500 error when uploading large feeds.

I get the following 500 error message when browsing the site, i.e. as a customer would browse it..

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, 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 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Im with 1and1 and as yet have not worked out how to view error logs. I have a business Pro account running php 5.4

So i'm baffled and thought someone might be able to help. it would be appreciated.

Regards

Rob

Submitted by support on Thu, 2013-09-26 08:10

Hello Rob,

A 500 Internal Server Error is indicative of a web server imposed timeout (as opposed to a PHP execution time limit) but would normally only affect the single process - i.e. your action of importing the feed rather than also affecting the user front-end of the site.

I don't think the Business Pro account has command line access, so if your feed is CSV it would be best to import using the Slow Import Tool. You can really speed up "slow import" by changing the parameters in config.advanced.php at lines 37-39 as follows:

  $config_slowImportBlock = 500;
  $config_slowImportSleep = 0;

These are the defaults in the latest distribution - and it's really not any slower than normal import then, and no single request to the web server lasts for more than a few seconds. If your feeds are XML, then drop me an email and I'll create a patch for the latest version of the slow import tool which includes slow import for XML as well as CSV...

Cheers,
David.
--
PriceTapestry.com

Submitted by robah on Thu, 2013-09-26 09:49

Hi David

Thanks for the reply. I'm getting 500 Internal Errors when browsing the finish site. The feeds upload no problem.

I don't think its a time out problem as the error appears immediately. If I hit refresh the site loads ok. then as I browse all seems ok, then I get another 500 error. hit refresh again and off I go.

I notice in Google webmaster tools they are getting lots of 500 error indexing the site.

Rob

Submitted by support on Thu, 2013-09-26 10:29

Hello Rob,

Ah sorry - that would indicate a possible .htaccess problem then. Syntax errors in .htaccess can cause 500 Internal Server Errors.

The first thing to try, temporarily rename .htaccess to something else and check if that displays the home page correctly. If that's the case, check if there are any obvious problems with the file, but if removing .htaccess does remove the error and you're not sure of the contents, post your current version and I'll check it over for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by robah on Sat, 2013-09-28 01:51

Hi David

I tried the files you emailed, but I'm still experiencing 500 errors. They are not all the time, but as I click through the site they occur. I then have to hit refresh 3 or 4 times.

See if you get them {links saved}

More times than not the sites work fine, but then out of the blue ... 500

regards and thanks

rob

Submitted by support on Sat, 2013-09-28 08:14

Hello Rob,

I tried a number of refreshes but wasn't able to get the error however I notice there is a lot going on on the home page so I wonder if it is an occasional Apache controlled timeout - or are you getting the 500 error immediately on the occasions that it happens?

If you'd like to forward your index.php and html/featured.php I'll check those out for you as there may be some quick optimisations that can be included...

Cheers,
David.
--
PriceTapestry.com

Submitted by robah on Thu, 2013-10-17 00:09

Hi David

Just an update for you. The 500 server errors are still occurring, but I think its do with my host 1&1.

I have 2 contract / accounts with them both have the PT script running on sites. One is fin and the other isn't. I've emailed them and await their response (I wont hold my breath for too long!!)

I will let you know what they say

Regards

Rob

Submitted by robah on Thu, 2013-10-17 23:10

Hi David

This is the reply from 1&1, it doesn't mean anything to me, does it mean anything to you regard PT

Thank you for contacting us.

Can you send us copy of a trace route when the error 500 happens again from your end. Also try to check using your ssh/putty access the work load for your website. Most common issue with the error 500. If your website is using too much resources.

If you have any further questions please do not hesitate to contact us.

Submitted by support on Fri, 2013-10-18 07:37

Hi Robah,

The trace route would enable them to confirm whether a redirection is happening on their network at the time when 500 errors are being returned. To create one, under Windows open a command prompt (Start > All Programs > Accessories > Command Prompt) and type the command:

tracert www.yoursite.com

Once the output has completed you can right-click in the command prompt window and select "Mark", then highlight the output of traceroute which will copy it to the clipboard which you can then paste into an email.

I know you have been using the script for many years, so if it is perhaps a resource issue due to a large database / busy site, it might be worth making sure that you're using the latest search and related products code. I can "back port" the upgrade for you easily, if you would like to drop me an email with your current search.php and products.php I'll check / advise, but also if there is a chance the 500 errors are maybe only occurring whilst your site is importing, it might be worth incorporating the 1 second sleep mod (this thread) which reduces load during import considerably...

Cheers,
David.
--
PriceTapestry.com

Submitted by keshavkshirsagar on Wed, 2015-09-16 12:34

Hello

Getting Internal Server Error

For Category pages and merchant pages

{link saved}

Product page is working fine

tracert Details

{code saved}

Submitted by support on Wed, 2015-09-16 13:19

Hi,

The reason for an Internal Server Error would normally be output in your web server's error log, but I see you are running a very large number of products on that installation (over 2 million) so it is most likely a web server imposed timeout in this case.

As you know I don't impose or suggest any particular limits for the script as it is really down to server capabilities, configuration optimisation and lots of other factors and whilst many users do work with very large databases it requires careful server configuration etc., and of course there is ultimately a limit, not necessarily just that MySQL can't handle that size of database (of course it can), but in terms of being able to search and sort so many rows within a reasonable response time.

Check out this thread regarding MySQL configuration for large installations, in particular with regards to the settings for key_buffer_size and sort_buffer_size which it is sometimes recommended can be allocated up to 1/4 of total available server memory between them which can improve performance significantly (the defaults are very small).

Personally, I would suggest breaking up such a large number of products into separate sub-category installations in sub-directories (so effectively, the sub-directory names acts as the top-level category name), and then you can use the built-in category hierarchy support to index sub-categories within that installation. Check out this thread for info and links to a top level "site search" script that demonstrates how to create a top level search form with category drop-down box for the users to select the sub-directory category installation to direct the query to.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com