---
title: "Fixing PHP Memory Errors in Magento"
description: "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..."
url: https://www.inmotionhosting.com/support/edu/magento/fixing-php-memory-errors-in-magento/
date: 2012-04-04
modified: 2023-10-04
author: "Carrie Smaha"
categories: ["Magento"]
tags: ["Magento v1.6"]
type: post
lang: en
---

# 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](/support/edu/cpanel/using-file-manager-in-cpanel/).

1. [Log into cPanel](/support/edu/cpanel/how-to-log-into-cpanel/) and open [File Manager](/support/edu/cpanel/using-file-manager-in-cpanel/)
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](https://www.inmotionhosting.com/support/wp-content/uploads/2012/04/magento_settings-window.png)](/support/wp-content/uploads/2012/04/magento_settings-window.png)
3. Right-click on the **index.php** file by right-clicking on the file and selecting **Code Edit** [![select code edit](https://www.inmotionhosting.com/support/wp-content/uploads/2012/04/magento_code-edit.png)](/support/wp-content/uploads/2012/04/magento_code-edit.png)
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](https://www.inmotionhosting.com/support/wp-content/uploads/2012/04/magento_magento_memory_error_3.jpg)](/support/wp-content/uploads/2012/04/magento_magento_memory_error_3.jpg)
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](https://www.inmotionhosting.com/support/wp-content/uploads/2012/04/magento_magento_memory_error_4.jpg)](/support/wp-content/uploads/2012/04/magento_magento_memory_error_4.jpg)

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](https://www.inmotionhosting.com/magento-hosting), please feel free to [ask a question on our Support Center](/support/questions/).
