I got this error when running composer.phar update
on my VM:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried t
It worked for me!
Download the zip 64-bit version of your PHP from this link: https://windows.php.net/download/
Now extract it to C:\PHP-74\ and rename the php.ini-development to php.ini
Now open this php.ini and uncomment the following by removing ; (semicolon).
extension_dir = "ext"
extension=bz2
extension=curl
extension=fileinfo
extension=gd2
extension=gettext
extension=mbstring
extension=exif ; Must be after mbstring as it depends on it
extension=mysqli
extension=openssl
extension=pdo_sqlite
In my scenario these extensions are required you can compare your old php.ini file of xampp or wamp resolve this one. Now save the file and run the following command.
"C:\PHP-74\php.exe" -d memory_limit=-1 "C:\ProgramData\ComposerSetup\bin\composer.phar" update
Try this one
COMPOSER_MEMORY_LIMIT=-1 composer require [package name]
It's a memory problem, not a storage issue. You are reaching your PHP memory limit.
Edit /etc/php.ini and increase the memory limit ( memory_limit = 128M replace with memory_limit = 256M )
I would suggest you look for the reason composer is using so much memory , and find ways to cut your PHP memory usage :
This is the issue you are having : https://github.com/composer/composer/issues/1898
Try increase the memory_limit value in your active php.ini file.
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 512M
For example.
php -d memory_limit=-1 /usr/local/bin/composer install
This command work for me.
Nothing worked for me except putting memory_limit = -1
in php.ini
file.