2

This question already has an answer here:

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

marked as duplicate by Fabian Schmengler, Keyul Shah, Qaisar Satti, Amit Bera, Marius Aug 3 '16 at 7:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • are you using shared hosting ? try contact hosting team once. – Baby in Magento Jul 28 '16 at 16:44
  • I talked to hosting provider but they said problem is not due to server but coding – Jwngdow Narzary Jul 28 '16 at 17:15
  • okay, can you take backup of these files & copy fresh magento 1.9 files and check once. – Baby in Magento Jul 28 '16 at 18:13
  • How many products and attributes do you have? The configurable swatches module doesn't perform well under large datasets – Robbie Averill Jul 29 '16 at 11:02
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) {
  • 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. – Jwngdow Narzary Jul 29 '16 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. – Raphael at Digital Pianism Jul 30 '16 at 7:41
  • thank you @RaphaelatDigitalPianism you save my Day.. +1 to you – Murtuza Zabuawala Oct 24 '16 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.