How To Fix PHP Fatal Error: Allowed Memory Size

You may encounter one of the common errors when running the PHP website source code. And in this article, I will guide you to fix PHP Fatal Error: Allowed Memory Size.

Cases of this error in Magento 2 are also common. For example: Install Theme, Install Extension,…

When encountering this error, an error message will appear:

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in C:\xampp\htdocs\magento232\vendor\oyejorge\less.php\lib\Less\Tree\Dimension.php on line 21
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in C:\xampp\htdocs\magento232\vendor\oyejorge\less.php\lib\Less\Tree\Dimension.php on line 21
Message Error Allowed memory size

Reason

The cause of this error is because the PHP process is executing using larger RAM resources that we have specified in the php.ini file through “memory_limit”.

Reason of error

This is the configuration table of “memory_limit”.

PHP: Fatal Error: Allowed Memory Size of 8388608 Bytes Exhausted 8 MB
PHP: Fatal Error: Allowed Memory Size of 16777216 Bytes Exhausted 16 MB
PHP: Fatal Error: Allowed Memory Size of 33554432 Bytes Exhausted 32 MB
PHP: Fatal Error: Allowed Memory Size of 67108864 Bytes Exhausted 64 MB
PHP: Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted 128 MB
PHP: Fatal Error: Allowed Memory Size of 268435456 Bytes Exhausted 256 MB
PHP: Fatal Error: Allowed Memory Size of 536870912 Bytes Exhausted 512 MB
PHP: Fatal Error: Allowed Memory Size of 1073741824 Bytes Exhausted 1 GB

You can collate to raise the appropriate value.

How To Fix PHP Fatal Error: Allowed Memory Size

  • First, You locate the directory of the php.ini directory. This will usually be etc/php.ini.
  • Next, You find the line “memory_limt =”
  • Finally, You adjust the value accordingly and save it.
Config memory limit value

Good luck!

It comes to the end of the article.

You can view the article How To Install Magento 2.3 In Windows Using XAMPP.

Follow us for more helpful article!

We hope this is a useful blog for you.

Thank you for reading!

5 2 votes
Article Rating

Adam Roger

CEO and Founder of Magetop. A friend, a husband and a dad of two children. Adam loves to travel to experience new cultures and discover what is happening with ecommerce all around the world.

Leave a Reply or put your Question here

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
huunguyen
huunguyen
May 7, 2020 3:56 am

Em chuyển về 256M rồi mà vẫn ko đc. vẫn bị lỗi như cũ. hy vọng a sẽ giúp được 🙁

2
0
Would love your thoughts, please comment.x
()
x