Magento Tutorials

Fixed: PHP Fatal Error “Allowed Memory Size” in Magento 2

Hello Magento Friends,

Today I will be providing the solution to resolve PHP Fatal Error “Allowed Memory Size” in Magento 2.

When you install an extension or theme to your Magento 2 store, you may come across below PHP Fatal Error:

“Fatal error: Allowed memory size of 134217728 bytes exhausted”

This is because the PHP process uses larger RAM resources compared to the “memory_limit” specified in the php.ini file.

Let’s find out the solution for PHP Fatal Error “Allowed Memory Size” in Magento 2

Steps to Fix PHP Fatal Error “Allowed Memory Size” in Magento 2:

Step 1:  First, you need to locate the directory of the php.ini directory. This will usually be  

/etc/php/version(ex. 7.4)/apache2

Step 2: Next, find the line “memory_limt =”

Step 3: Finally, you can adjust the value accordingly and save it

Step 4: After modifying the php.ini file you need to restart your apache server. Use the below command

systemctl restart apache2

Conclusion:

This way you can easily solve the PHP Fatal Error “Allowed Memory Size” in Magento 2. Also, look at the below article in case you face the error

Solved: PHP Fatal Error “Call to Undefined Function str_contains()” After Upgrading to Magento 2.4.x

In case you are unable to get rid of the error, let me know through the comment section. 

Happy Reading!

Click to rate this post!
[Total: 2 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

Recent Posts

Improving Error Handling and Transition Management in Remix with useRouteError and useViewTransitionState

In modern web development, seamless navigation and state management are crucial for delivering a smooth…

6 days ago

Magento Open Source 2.4.8-Beta Release Notes

Magento Open Source 2.4.8 beta version released on October  8, 2024. The latest release of…

1 week ago

How to Create Catalog Price Rule in Magento 2 Programmatically?

Hello Magento Friends, Creating catalog price rules programmatically in Magento 2 can be a valuable…

1 week ago

Top 10 Tips to Hire Shopify Developers

As the world of eCommerce continues to thrive, Shopify has become one of the most…

2 weeks ago

Managing Browser Events and Navigation in Shopify Remix: useBeforeUnload, useHref, and useLocation Hooks

Shopify Remix is an innovative framework that provides a streamlined experience for building fast, dynamic,…

2 weeks ago

Ultimate Guide to Hiring a Top Shopify Development Agency

Building a successful eCommerce store requires expertise, and for many businesses, Shopify has become the…

2 weeks ago