How to Fix “Composer detected issues in your platform: Your Composer dependencies require a PHP version ‘>= 8.2.0′” Error After Deploying Laravel 11 on a Linux Server with Apache2

Introduction

Deploying a Laravel 11 project on a Linux server with Apache2 Virtual Host can sometimes lead to unexpected errors. One common issue that developers encounter is the following error message:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0"

Solution

Add this code in to your Virtual Host.

<FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
</FilesMatch>

This will fix your issue.

Leave a Comment