Looking for a PHP version of PHP 8.1 for a specific virtual website
P粉974462439
P粉974462439 2024-03-26 10:24:50
0
2
402

I have a dummy website written in Laravel9 on an ubuntu 18.04 server, it requires php version 8.0.2 or higher. The error looks like this in the browser:

Composer has detected a problem on your platform: Your Composer dependency requires PHP version '>= 8.0.2'.

In the system I have PHP 7.4.29 (cli) but can't change it since other virtual sites require 7.4.

How to get php 8.1 to Laravel9 site to make it work?

P粉974462439
P粉974462439

reply all(2)
P粉037880905

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

P粉793532469

Okay, I found that what is needed is a composer command:

composer install --ignore-platform-reqs

So now there are no more errors. Now I have other things to worry about, but that's Laravel's thing.

My other sites still work fine despite now being on php 8.1.

thanks for your help.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template