Question: I got this error when running `composer.phar update` on my VM:

> 
> PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 144115188075867549 bytes) in phar:///bin/composer.phar/src/Composer/Util/RemoteFilesystem.php on line 179
> 
> 
> 

The `composer.json`, if needed:

```
{
        "description" : "The CodeIgniter framework",
        "name" : "codeigniter/framework",
        "license": "MIT",
        "require": {
                "php": ">=5.2.4",
                "videlalvaro/php-amqplib": "2.5.*"
        },
        "require-dev": {
                "mikey179/vfsStream": "1.1.*",
                "videlalvaro/php-amqplib": "2.5.*"
        }
}

```

The VM just recently recovered from a bad disk sector problem, and the guy running the VM said that the VM has been moved to a new disk. There are only Java, PHP, httpd, postgre, rabbitmq and the website itself in my VM, and it already ran perfectly for about 4 months before this happened. I'm using PHP 5.6.11. Can anyone help please?

Answer: 
It worked for me!

Download the zip 64-bit version of your PHP from this link:
<https://windows.php.net/download/>

[![enter image description here](https://i.stack.imgur.com/72Kqg.png)](https://i.stack.imgur.com/72Kqg.png)

Now extract it to C:\PHP-74\ and rename the **php.ini-development** to **php.ini**

[![php.ini](https://i.stack.imgur.com/Iruni.png)](https://i.stack.imgur.com/Iruni.png)

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

```
If you are running into composer memory problems, now your best option is probably to use composer v2, if you can.

Composer v2 has many performance improvements and as a result, it takes much less memory.

I was always having to use `COMPOSER_MEMORY_LIMIT=-1 composer update` but after the v2 update, I no longer need to use this.

Check out the release announcement <https://blog.packagist.com/composer-2-0-is-now-available/> or download the latest version <https://getcomposer.org/download/>