skip to Main Content

Hi, I am trying solve some problem when I am install voyager.
When I try to run composer require I am getting the out of memory error. I am not understand what exably happend. Its result on my console:

@DESKTOP->>>>> /c/xampp/htdocs/ (master)
$ composer require tcg/voyager
Using version ^1.4 for tcg/voyager
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar://C:/composer/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 83“`

Maybe there’s a problem with the composer.JSON, something I need to check out. What you should pay attention to what is the problem
My composer.json file“`
{

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
    "framework",
    "laravel"
],
"license": "MIT",
"require": {
    "php": "^7.2",
    "convertapi/convertapi-php": "^1.1",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "^6.2",
    "laravel/socialite": "^4.3",
    "laravel/tinker": "^1.0",
    "openpayu/openpayu": "^2.2",
    "paypal/rest-api-sdk-php": "^1.14",
    "pragmarx/tracker": "^3.5",
    "spatie/laravel-backup": "^6.8",
    "spatie/pdf-to-image": "^2.0",
    "tcg/voyager": "^1.3"
},
"require-dev": {
    "facade/ignition": "^1.4",
    "fzaninotto/faker": "^1.4",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^3.0",
    "phpunit/phpunit": "^8.0",
    "tanmuhittin/laravel-google-translate": "^1.0"
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"autoload": {
    "psr-4": {
        "App\": "app/"
    },
    "files": [
        "app/Helpers/HelperFunctions.php"
    ],
    "classmap": [
        "database/seeds",
        "database/factories"
    ]
},
"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"
    ]
},
"repositories": {
    "hooks": {
        "type": "composer",
        "url": "https://larapack.io"
    }
}

}

3

Answers


  1. Looks like you are using xampp.
    you can try to change the memory_limit in php.ini.
    enter image description here

    Find this:

    ;memory_limit=512M 
    

    Change to :

    memory_limit =-1
    

    Then restart the Apache from xampp

    Login or Signup to reply.
  2. You can also install the voyager into your server using this command:
    COMPOSER_MEMORY_LIMIT=-1 composer require tcg/voyager

    instead of just composer require tcg/voyager

    I found this on this thread. Hope it helps. Andy Song solution is better though.

    Login or Signup to reply.
  3. If your composer is in /usr/local/bin/ use:

    php -d memory_limit=-1 /usr/local/bin/composer require tcg/voyager
    

    refer to composer document https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

    To get the current memory_limit value, run:

    php -r "echo ini_get('memory_limit').PHP_EOL;"
    

    Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):

    ; Use -1 for unlimited or define an explicit value like 2G

    memory_limit = -1
    

    Composer also respects a memory limit defined by the COMPOSER_MEMORY_LIMIT environment variable:

    COMPOSER_MEMORY_LIMIT=-1 composer.phar <...>
    

    Or, you can increase the limit with a command-line argument:

    php -d memory_limit=-1 composer.phar <...>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search