How to Override PHP Base Dependency in Composer
Problem:
A user attempting to install Laravel 5.1 on a server with PHP 5.5.6 encounters an error due to a PHP dependency greater than 5.5.9. The hosting provider is unable or unwilling to upgrade PHP, making it necessary to find a way to bypass the dependency.
Solution:
To override the PHP dependency in Composer, the user can utilize the --ignore-platform-reqs option. This option ignores dependencies such as PHP, hhvm, and ext-* that may not be met by the local machine.
As per the Composer documentation:
--ignore-platform-reqs: ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill these. See also the platform config option.
By executing the following command, the user can override the PHP dependency and proceed with the Composer installation:
composer install --ignore-platform-reqs
The above is the detailed content of How to Install Laravel 5.1 with PHP 5.5.6 Using Composer?. For more information, please follow other related articles on the PHP Chinese website!