In deze tutorial laten we je zien hoe het eenvoudig is om PHP 7.4 op CentOS 8 te installeren.
PHP is een populaire scripttaal voor algemene doeleinden die vooral geschikt is voor webontwikkeling. Snel, flexibel en pragmatisch, PHP drijft alles aan, van je blog tot de meest populaire websites ter wereld.
Laten we beginnen met het installatieproces.
1. Installeer Remi-repository
Standaard installeert CentOS 8 PHP 7.2 en PHP 7.3. Om PHP 7.4 eerst te installeren, moeten we Remi-repository installeren, die de PHP 7.4-pakketten zal leveren die we willen installeren, samen met enkele handige hulpprogramma's voor pakketbeheer.
# dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
2. Bekijk vervolgens de beschikbare PHP-modules door te rennen.
# dnf module list php
Uitgang:
Extra Packages for Enterprise Linux Modular 8 - x86_64 208 kB/s | 117 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 3.8 MB/s | 6.6 MB 00:01
Remi’s Modular repository for Enterprise Linux 8 - x86_64 456 kB/s | 567 kB 00:01
Safe Remi’s RPM repository for Enterprise Linux 8 - x86_64 1.1 MB/s | 1.5 MB 00:01
CentOS-8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common, devel, minimal PHP scripting language
Remi’s Modular repository for Enterprise Linux 8 - x86_64
Name Stream Profiles Summary
php remi-7.2 common [d], devel, minimal PHP scripting language
php remi-7.3 common [d], devel, minimal PHP scripting language
php remi-7.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Voer vervolgens de volgende dnf-opdrachten uit om de PHP remi-7.4-stream in te schakelen.
# dnf module reset php -y
# dnf module enable php:remi-7.4 -y
3. Installeer PHP 7.4
# dnf install php -y
4. Controleer de installatie
Om de installatie te verifiëren, controleert u de versie van de PHP met behulp van de volgende opdracht:
# php -v
De uitvoer ziet er als volgt uit:
PHP 7.4.6 (cli) (built: Oct 12 2020 08:09:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
We hebben PHP 7.4 met succes geïnstalleerd.
In deze tutorial hebben we je laten zien hoe het eenvoudig is om PHP 7.4 te installeren op CentOS 8.
Bekijk onze 10 Gbps dedicated serverplannen .