Override PHP base dependency in composer

Override PHP base dependency in composer

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Override PHP base dependency in composer

When attempting to deploy Laravel 5.1 on a host running PHP 5.5.6, you will encounter an immediate blockage during the composer.phar install phase. The error message is explicit: - This package requires php >=5.5.9 but your PHP version (5.5.6) does not satisfy that requirement.

This restriction exists because Composer validates the runtime environment against the require and conflict sections defined in a package's composer.json file before allowing installation to proceed. The specific error indicates that the minimum PHP version required by Laravel 5.1 (or one of its dependencies) is 5.5.9, and the host is currently running 5.5.6.

The underlying assumption when this error appears is often that the difference between patch versions like 5.5.6 and 5.5.9 is negligible—merely a collection of bug fixes. While logically sound in many contexts, Composer treats these requirements as hard constraints to ensure stability and compatibility. You cannot simply proceed by ignoring the check without explicit configuration, as doing so might lead to runtime failures where features present in 5.5.9 are missing or behave differently than expected in 5.5.6.

To bypass this specific version check, you must use the --ignore-platform-reqs flag. This command-line option instruct Composer to skip all platform requirement checks, including PHP version constraints, for both the root project and its dependencies. You can execute the installation with the following command:

composer.phar install --ignore-platform-reqs

This approach effectively overrides the php >=5.5.9 constraint found in the package metadata, allowing the installer to proceed regardless of the actual PHP version on the server.

However, this solution comes with significant trade-offs that every engineer must weigh carefully. By using --ignore-platform-reqs, you are essentially telling Composer to trust your judgment regarding the missing features or bug fixes introduced between 5.5.6 and 5.5.9. If Laravel 5.1 relies on a specific extension or internal PHP function that was only stabilized in patch version 5.5.9, your application may crash immediately after deployment with a "Call to undefined function" or similar error.

Furthermore, this flag is global to the command execution. It does not selectively ignore just the PHP requirement for Laravel while keeping other checks active; it disables the platform check entirely. This means you lose Composer's safeguard against installing packages that require specific OS versions or missing extensions if those constraints are also present in your composer.json.

There is a distinction between ignoring requirements during installation and ignoring them globally. If you want to make this change permanent for all future commands on a specific machine, you can configure it within the .composer/config.json file. In this scenario, you would add a configuration entry that sets the platform requirements check to false:

{
    "config": {
        "platform-check": false
    }
}

Once configured, you can run composer install without the flag, and Composer will apply the override by default. This is particularly useful for legacy hosting environments where upgrading PHP is not feasible due to strict server constraints or third-party software dependencies that cannot be recompiled against newer PHP versions.

It is crucial to remember that overriding these requirements does not modify the code itself; it only bypasses the validation logic. The application code still assumes the presence of features available in 5.5.9. If your project depends on specific bug fixes introduced in that patch release, you are accepting the risk of encountering those issues in production.

For projects where upgrading PHP is impossible but deployment is critical, this override provides a viable path forward, provided you have thoroughly tested the application with the lower PHP version to ensure no critical functionality breaks. If you need further guidance on managing legacy Laravel versions or specific hosting constraints, resources like https://laravelcompany.com can offer insights into maintaining older stacks safely.

Our network