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
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”.
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 beetc/php.ini
.
- Next, You find the line “memory_limt =”
- Finally, You adjust the value accordingly and save it.
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!
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 🙁
Lỗi này bạn cần tăng memory limit lên bạn nhé. vd: bạn để 256MB mà bị lỗi thì bạn phải tăng lên 512MB,nếu vẫn bị thì bạn cần tăng lên 1024MB.