I am using composer on my Laravel 6 project. However, somehow I always run into the problem is "Allowed memory size of 1610612736 bytes exhausted". I don't know why but since a few days I have this problem and I don't know why or where it does come from.
The curios thing is that I get exactly the same error on my development server. That means it must has to do something with the Laravel project itself. Because as I said, on my Mac as well as on my development server I get the exact same output with exact the same config and project.
The only workaround is php -d memory_limit=-1 composer update
. But I cannot do this on my server because I am not the admin of the server and have a limited RAM usage. So, I do want to know what is causing this problem and how I can solve this.
Do you need any more information then those below? I appreciate any kind of help!
Kind regards and thank you!
My composer.json
:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "https://nova.laravel.com"
}
],
"require": {
"php": "^7.2",
"components/jquery": "^3.4",
"cybercog/laravel-nova-ban": "^1.1",
"emilianotisato/nova-tinymce": "^1.1",
"fideloper/proxy": "^4.0",
"glorand/laravel-model-settings": "^3.5",
"inspheric/nova-indicator-field": "^1.43",
"kabbouchi/nova-logs-tool": "^0.2.0",
"laravel/framework": "^6.2",
"laravel/nova": "~2.0",
"laravel/socialite": "^4.4",
"laravel/telescope": "^3.0",
"laravel/tinker": "^1.0",
"laravel/ui": "^1.1",
"laravelcollective/html": "^6.1",
"llaski/nova-scheduled-jobs": "^3.0",
"mad-web/nova-telescope-link": "^3.0",
"orangehill/iseed": "^2.6",
"paquettg/php-html-parser": "^2.1",
"pdewit/nova-external-url": "^1.0",
"phpunit/php-code-coverage": "^9.1",
"phpunit/phpunit": "^9.2",
"spatie/laravel-honeypot": "^1.4",
"spatie/laravel-medialibrary": "^7.19",
"spatie/laravel-permission": "^3.2",
"twbs/bootstrap": "^4.3",
"vyuldashev/nova-permission": "^2.9",
"yoeunes/toastr": "^1.2"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.6",
"brianium/paratest": "^4.1",
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
],
"files": [
"app/Helpers/helper.php",
"app/Helpers/commentsHelper.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta"
]
}
}
Output of composer diagnose
:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.10.10
PHP version: 7.3.18
PHP binary path: /usr/local/Cellar/php@7.3/7.3.18_1/bin/php
OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
When I run this command:
(Basically any commands where I install, remove or update packages)
composer update
composer install
...
...
I get the following output:
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.10.7/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/Cellar/composer/1.10.7/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.