skip to Main Content

I have a virtual website in an ubuntu 18.04 server that is written in Laravel9 and it needs php version 8.0.2 or higher. The error looks like this in the browser:

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

In the system I have PHP 7.4.29 (cli) but can’t change that due to other virtual sites who need 7.4.

How do I get php 8.1 to the Laravel9 site so it works?

2

Answers


  1. Chosen as BEST ANSWER

    Ok, found out that what was needed was a composer command:

    composer install --ignore-platform-reqs
    

    So now no error anymore. Now I have other things to worry about, but thats Laravel stuff.

    My other sites works ok despite php 8.1 now.

    Thanks any way for your help.


  2. If using Debian/Ubuntu:

    apt -y install software-properties-common
    add-apt-repository ppa:ondrej/php
    apt -y install php8.1
    

    CentOS:

    dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
    
    dnf remove php* -y
    dnf module list reset php -y
    dnf module enable php:remi-8.1
    dnf install php
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search