1

I installed the Laravel-Pagebuilder but I could not make use of it, when I tried to reinstall it using this

      composer require hansschouten/phpagebuilder 

it gave me this error

      Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://file_directory/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

so I had to prepend the following to it

      COMPOSER_MEMORY_LIMIT=-1

And this produces the following error

         Your requirements could not be resolved to an installable set of packages.

        Problem 1
          - The requested package hansschouten/phpagebuilder (locked at v0.13.0, required as ^0.18.0) is satisfiable by hansschouten/phpagebuilder[v0.13.0] but these conflict with your requirements or minimum-stability

When I treid to remove the package, it gave me the following error

         Your requirements could not be resolved to an installable set of packages.

        Problem 1
          - The requested package hansschouten/phpagebuilder (locked at v0.13.0, required as ^0.18.0) is satisfiable by hansschouten/phpagebuilder[v0.13.0] but these conflict with your requirements or minimum-stability

I know I am using laravel 8 but when I tried to find the version of laravel I am using it gave me the following

 php artisan -V

   TypeError

  Argument 1 passed to PHPageBuilder\PHPageBuilder::__construct() must be of the
 type array, null given, called in installation_directory\vendor\hansschouten\laravel-pagebuilder\src\ServiceProvider.php on line 43

  at installation_directory\vendor\hansschouten\phpagebuild
er\src\PHPageBuilder.php:47
     43      * PHPageBuilder constructor.
     44      *
     45      * @param array $config         configuration in the format defined in config/config.example.php
     46      */
     47     public function __construct(array $config)
     48     {
     49         if (session_status() === PHP_SESSION_NONE) {
     50             session_start();
     51         }
           }


  1   installation_directory\vendor\hansschouten\laravel-pagebuilder\src\ServiceProvider.php:43
      PHPageBuilder\PHPageBuilder::__construct()

  2   installation_directory\vendor\laravel\framework\src\Illuminate\Container\Container.php:805
      HansSchouten\LaravelPageBuilder\ServiceProvider::HansSchouten\LaravelPageBuilder\{closure}(Object(Illuminate\Foundation\Application), [])

Please I would appreciate any help, It is preventing me from doing any work

update composer content

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "hansschouten/laravel-pagebuilder": "^0.10",
        "hansschouten/phpagebuilder": "^0.10",
        "huddledigital/zendesk-laravel": "^3.5",
        "laravel/framework": "^8.0",
        "laravel/tinker": "^2.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "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"
        ]
    }
}
J.Whit
  • 125
  • 10
  • Just a suggestion, but try and `remove` it and then re-require it – RiggsFolly Dec 29 '20 at 13:23
  • @RiggsFolly I have already tried to remove it as I stated in the question. but it is not allowing me to remove it – J.Whit Dec 29 '20 at 13:28
  • Can you show your full composer.json? – aynber Dec 29 '20 at 13:32
  • Did you `composer remove hansschouten/phpagebuilder` ? – RiggsFolly Dec 29 '20 at 13:32
  • @RiggsFolly YES!!!! – J.Whit Dec 29 '20 at 13:39
  • That was NOT CLEAR from what you wrote in your question. Thanks for clearing that up – RiggsFolly Dec 29 '20 at 13:40
  • @RiggsFolly I said i tried to remove the package. I believe the only way to remove package is tru `composer remove` ..... – J.Whit Dec 29 '20 at 13:42
  • @aynber composer provided – J.Whit Dec 29 '20 at 13:44
  • 1
    J Yup, but we dont know you. History shows that if we ASSUME, it just makes an Ass of U and Me. So if it is not made completely clear HOW you tried to remove the package, we need to ask for clarity – RiggsFolly Dec 29 '20 at 13:46
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/226565/discussion-between-j-whit-and-riggsfolly). – J.Whit Dec 29 '20 at 13:49
  • @RiggsFolly this is what I typed into the console and the response > composer remove hansschouten/laravel-pagebuilder > Dependency "hansschouten/phpagebuilder" is also a root requirement, but is not explicitly allowed. Ignoring. >Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. – J.Whit Dec 29 '20 at 13:54
  • @J.Whit Does the article help you? https://stackoverflow.com/questions/49212475/composer-require-runs-out-of-memory-php-fatal-error-allowed-memory-size-of-161 – Thân LƯƠNG Đình Dec 29 '20 at 14:00
  • Did you try removing your composer.lock and try again? – aynber Dec 29 '20 at 14:03
  • @ThânLƯƠNG I have tried COMPOSER_MEMORY_LIMIT=-1 composer require hansschouten/phpagebuilder but it is still giving me error – J.Whit Dec 29 '20 at 14:04
  • @aynber how can i remove composer.lock? – J.Whit Dec 29 '20 at 14:06
  • There's a file called `composer.lock` in the same directory as your json. If it's there, remove it. – aynber Dec 29 '20 at 14:08
  • @aynber It is there but would it not have any effect on other part of the project f I remove it? – J.Whit Dec 29 '20 at 14:12
  • No, it's recreated any time you run composer. However, composer may look at the lock file when running update/install instead of looking for updates. It's a good idea to remove it first – aynber Dec 29 '20 at 14:15
  • @aynber I have remove it, I tried getting the version type but it is giving me error – J.Whit Dec 29 '20 at 14:16
  • @aynber I have done that but it still gave me the same error – J.Whit Dec 29 '20 at 14:28

0 Answers0