0

I try to install a package in Symfony 4 and I get an error message:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  
!!   // Clearing the cache for the dev environment with debug                       
!!   // true                                                                        
!!  
!!  
!!  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Users/coding/myproject/vendor/twig/twig/src/Node/Expression/NameExpression.php on line 27
!!  
!!  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /Users/coding/myproject/vendor/symfony/var-dumper/Cloner/Data.php on line 321
!!  
Script @auto-scripts was called via post-update-cmd

I tried to increase the memorey limit by updating my php.ini:

memory_limit = 2048M

But still I get the same error message

5
  • Did you check with a phpinfo that when you set memory_limit it actually worked? Commented Mar 6, 2022 at 16:23
  • Did you edit the correct php.ini file? There usually is one for CLI and one for webservers Commented Mar 6, 2022 at 16:24
  • @ARIFMAHMUDRANA Yes, I checked php info, it is correctly 2048M Commented Mar 6, 2022 at 16:37
  • What actually solved the problem is, I was searching for the php.ini via php --ini and this file I changed. And it worked then Commented Mar 6, 2022 at 16:52
  • This question isn't a duplicate, it's an actual problem. The key is the @auto-scripts in the last line, this is something in composer.json that runs the command but you can't add parameters to increase the memory. Commented Jul 26, 2022 at 12:29

1 Answer 1

3

Use php -d memory_limit=-1 bin/console [your command]

Sign up to request clarification or add additional context in comments.

2 Comments

tested it but the message is: Could not open input file: bin/console
depends in which directory you are - the answer is correct.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.