1

I have a module installed via Composer where the latest master version requires PHP 7.0.x, while the updated version I'm using allows PHP 7.1.x which I have installed.

This causes a problem that on each composer update, it gives a platform requirement error. This can easily be solved by adding --ignore-platform-reqs to the command.

However, I want to install some stuff with Composer using Magento 2 CLI. Specifically, the sample data:

bin/magento sampledata:deploy

Gives the Composer error that the PHP version is incorrect.

[my_module x.x.x] requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP vers ion (7.1.17) does not satisfy that requirement.

Is there a way to ignore platform requirements while deploying sample data?

1

The command sampledata:deploy is mapped to Magento\SampleData\Console\Command\SampleDataDeployCommand::execute.

inside this method you will find a variable $commonArgs = ['--working-dir' => $baseDir, '--no-progress' => 1];

You can add --ignore-platform-reqs=>1 in this array.

Of course you should do a plugin for this method and not edit the core.
If it's for test / debug purposes you can edit it temporarily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.