Composer: Fatal error: Out of memory (allocated 363331584) (tried to allocate 10343341 bytes) in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ComposerRepository.php on line 339

Created on 15 Oct 2018  ·  3Comments  ·  Source: composer/composer

I am using the dedicated server on CENTOS 7.5, Having 64GB Ram, I have set memoery_limit=-1 and verified by the following command.
$ php -r "echo ini_get('memory_limit').PHP_EOL;"
Result -1
Note: on composer 1.6.5 everything was fine. I just updated composer 1.7.2. Then memory issues started. Now I am unable to update the composer.

I am tired, I am unable to resolve this issue, even after memory increased. So I wanted to uninstall composer 1.7.2 and wanted to install again 1.6.5 version on WHM. Please help me to do so for all users of WHM. Actually, I don't have much exp in WHM.

My composer.json:
```{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.",
"yaap/theme": "2.
",
"nwidart/laravel-modules": "^0.11.1",
"cartalyst/sentinel": "2.0.",
"guzzlehttp/guzzle": "~5.3|~6.0",
"anhskohbo/no-captcha": "^2.1",
"laracasts/flash": "^2.0",
"laravelcollective/html": "~5.0",
"laracasts/presenter": "^0.2.1",
"atayahmet/laravel-nestable": "^0.6.37",
"maatwebsite/laravel-sidebar": "~2.1",
"vimeo/vimeo-api": "^1.2",
"google/apiclient": "2.1.1",
"phpoffice/phpexcel": "1.8.0",
"predis/predis": "^1.1",
"cviebrock/eloquent-sluggable": "4.1.
",
"intervention/image": "^2.4",
"spatie/laravel-backup": "^3.0.0",
"laravel/socialite": "~2.0",
"torann/currency": "^1.0",
"laracasts/utilities": "^2.0",
"barryvdh/laravel-dompdf": "^0.8.2",
"chencha/share": "^5.2",
"gloudemans/shoppingcart": "^2.5"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.
|3.0.",
"symfony/dom-crawler": "2.8.
|3.0.*",
"barryvdh/laravel-debugbar": "~2.4"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/",
"Modules\": "Modules/"
},
"files": [
]
},
"autoload-dev": {
"classmap": []
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}

```

Support

Most helpful comment

What PHP version do you have?

PS. If you used self-update you can rollback to the previous version with -r argument. https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-

All 3 comments

What PHP version do you have?

PS. If you used self-update you can rollback to the previous version with -r argument. https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-

It seems like it's since composer version 1.8.0, only setting memory_limit=-1 could help me, also observed, that i require more than 1.6 GB of memory.

If you have 32 bit PHP you won't be able to use your whole RAM. I had same problem on my 16GB RAM machine yesterday. Fixed it by switching to PHP 64bit and than ramping up memory limit.

Was this page helpful?
0 / 5 - 0 ratings