Fixing PHP Memory Errors in Magento

Magento can be quite memory intensive due to its robust design. You can adjust the memory limits to reduce or eliminate the memory errors altogether. You’ll have to add code to 2 separate files and we’ll walk you through the process using the file manager in cPanel.

  1. Log into cPanel and open File Manager
  2. In the top right corner of your File Manager, click on Settings. Navigate to the root folder for your Magento Installation. select directory in settings
  3. Right-click on the index.php file by right-clicking on the file and selecting Code Edit select code edit
  4. Click OK
  5. Add the following line after the first line of code: ini_set("memory_limit","512M");
  6. Click Save Changes in the upper right corner magento_memory_error_3
  7. Go back to File Manager and open the app/Mage.php file with the code editor in the same manner you opened the index.php file above
  8. After the first line of code add the following line of code: ini_set("memory_limit","512M");
  9. Click “Save Changes” in the upper right corner magento_memory_error_4

At this point you should be able to re-load your website and the errors should no longer appear on your pages.

If you need further assistance on Hosting for Magento, please feel free to ask a question on our Support Center.

Carrie Smaha
Carrie Smaha Senior Manager Marketing Operations

Carrie enjoys working on demand generation and product marketing projects that tap into multi-touch campaign design, technical SEO, content marketing, software design, and business operations.

More Articles by Carrie

10 thoughts on “Fixing PHP Memory Errors in Magento

Was this article helpful? Join the conversation!

Questions about our MailChannels Deployment? We have answers and are here to help!Learn More
+