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

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

2 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

5 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

5 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

6 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

6 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

1 week ago