2

I did not even change any code or configure other than changing image in my slide show, which I have done earlier but I am continuously receiving these two errors on some of my pages including homepage and I have no idea why. Could anyone from the community please help me how to solve these errors? I am still learning Magento.

Below is the error:

PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/ommobhm2/public_html/narzary/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php on line 82

PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/ommobhm2/public_html/narzary/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 90

4
  • are you using shared hosting ? try contact hosting team once. Jul 28, 2016 at 16:44
  • I talked to hosting provider but they said problem is not due to server but coding Jul 28, 2016 at 17:15
  • okay, can you take backup of these files & copy fresh magento 1.9 files and check once. Jul 28, 2016 at 18:13
  • How many products and attributes do you have? The configurable swatches module doesn't perform well under large datasets
    – scrowler
    Jul 29, 2016 at 11:02

3 Answers 3

2

That's a known issue I'm pretty sure there's a post about it on Magento SE but can't get my hands on it.

Basically there's a speed bug in the attachConfigurableProductChildrenAttributeMapping method of Mage_ConfigurableSwatches_Helper_Mediafallback

To fix the issue copy this file to app/code/local/Mage/ConfigurableSwatches/Helper/Mediafallback.php and move the following snippet:

 $optionLabels = array_map(function ($value) {
  return array_map('Mage_ConfigurableSwatches_Helper_Data::normalizeKey', $value);
 }, $optionLabels);

Before this code:

foreach($parentProducts as $parentProduct) {
3
  • Thank you so much. It helped me solve my problem. You won't believe that I paid $20 to a guy in freelancer to solve this issue and he solved it just by disabling the Configurable Swatches. For hours I thought he really solved it, until I noticed that it was simply disabled. I had no time so had to pay for my lack of knowledge. Jul 29, 2016 at 22:19
  • @JwngdowNarzary sad to hear. Feel free to post your questions here and on the Magento forums, the community is great and you'll always find someone willing to help. Jul 30, 2016 at 7:41
  • thank you @RaphaelatDigitalPianism you save my Day.. +1 to you Oct 24, 2016 at 10:35
0

Edit php.ini file. Find the line max_execution_time and change its value to 300:

max_execution_time = 300 //300 seconds = 5 minutes

or write one of the below line of code in the index.php in the root

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

or

ini_set('max_execution_time', 0); //no limit

-1

Magento use more resources sometime it is only the case when you have more than 2000 products, so use:

ini_set('memory_limit', '256M'); 

in the index.php in the root.

Not the answer you're looking for? Browse other questions tagged or ask your own question.