Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stack Overflow Error


Blake7

Recommended Posts

Posted

Hi, wonder if anyone can help?

 

When I click on a certain category of products, an error message in the top left of the screen says 'PHP has encountered a Stack overflow', and after a long time trying to load, goes to a Page Cannot Be Displayed. This only happens customer-side, and not in the admin panel.

 

The only thing I can think of which may be causing it is because the category has a large number of sub categories - however I thought OsCommerce allowed unlimited categories and sub categories?

 

Any thoughts or advice would be appreciated - perhaps it is a coding error??

 

Many thanks.

Posted

That's an odd one. I've never seen (or heard of) that error happening. How many subcategories do you have under this category, plus products at this level? If it's a huge number, I could imagine an "out of space" error from PHP, but not a stack overflow. All I can guess is that there's a glitch in your data that is somehow causing infinite recursion -- it just keeps going deeper and deeper, looping around some category, until PHP notices that it's run out of space for its stack. The only suggestion I can offer is that you check to see if one subcategory is directly or indirectly a child of itself. That could cause osC to loop forever going down the chain of categories (and build up an infinite stack). There ought to be some code in osC that checks for this, but it might fail if a category is not directly a child of itself (e.g., category A has subcategory B, which in turn has subcategory A).

Posted

Thanks very much for the help. I had a look through all the different values in the database moving products around in and out of categories to see what triggered the error. It turns out that, for some reason, there were too many queries of the database when the expanded sub-categories reached over 255. Probably there is a better fix for this, but I just used this contribution http://www.oscommerce.com/community/contri...ns,4754/page,66 as the sub categories weren't really required anyway. Works absolutely fine now.

 

Thanks again for the point in the right direction with the data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...