Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip composer PHP requirement

People also ask

Is PHP required for composer?

And there really is no way to make Composer deal with this situation. The PHP version that is used when running composer update determines the resolution of dependencies, being influenced by PHP version and installed PHP extensions. You cannot define that a package should only be used for PHP versions between 5.3.

What PHP version does composer use?

So, while the 7.2 version is used to run Composer, the scripts called by Composer use the default command.

How do I install composer PHP packages without composer?

All packages using composer are still mere directories full of PHP files. You can install them exactly the same way you did before composer existed: copy them somewhere and include the files. Composer-based installation implies running a single command, which is almost always shown in the package home page.


I've found the option:

composer install --ignore-platform-reqs

Ignore platform requirements (php & ext- packages).


Edit: You can skip the platform checks with this, but Composer will fetch packages based on given PHP version then. So when you need composer to also emulate a PHP version during depedency resolving, you can (and should!) use this in your composer.json:

{
    "config": {
       "platform": {
           "php": "5.6.6"
       }
    }
}

https://getcomposer.org/doc/06-config.md#platform


For many commands, you can tell composer to bypass php version check, with parameter "--ignore-platform-reqs":

composer COMMAND --ignore-platform-reqs

this will bypass php version specification.

Be aware that the software may work or not: php version specification is there because somewhere in the code is needed at least the specified php version, so if you use that code the software will break.