How to fix PHP fatal error in Laravel? Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes)

Whenever we type the below displayed command

locobucci error

We see the command runs initially good but there comes some problem in few moments. similar to

php fatal error

This error is PHP fatal error: and complete display image is

fatal error complete image

What we need to do to remove this ?

Folllow the below steps:

  1. Close the xampp if its running.
  2. got to “C:\ProgramData\ComposerSetup\bin” (we can copy the location and paste it in the explorer header)
explorer heading

just press on the above header (after pc) and paste the location and press enter

composer setup/bin location

This will open the file location:

3. We then need to open the composer.bat to edit it (right click on it and click on edit with notepad++)

4. Now just copy the below code and replace it with the code present in composer.bat

Code:

@echo OFF
:: in case DelayedExpansion is on and a path contains ! 
setlocal DISABLEDELAYEDEXPANSION
php -d memory_limit=-1 "%~dp0composer.phar" %*

5. Now save it. For saving it

  • Press (Ctrl + S)
  • we will be prompted as run as Administrator.
  • press Allow
  • Then again Press ( Ctrl + S)
  • The file will be saved.

Now we can run the above command and check it.

we will see the command execuites sucessfully

Happy Coding!

abhishek k
Tagged : / / / / / / /

Leave a Reply