Otu esi etinye PHP 8.0 na Rocky Linux 8

PHP 8.0 bụ mmelite dị ịrịba ama nke asụsụ PHP ewepụtara na Nọvemba 26, 2020, nnukwu mmụba na ntọhapụ PHP 7.4 dị. PHP ọhụrụ ahụ nwere ọtụtụ atụmatụ na nkwalite ọhụrụ, gụnyere arụmụka akpọrọ aha, ụdị otu, njiri mara, nkwalite ihe nrụpụta, okwu egwuregwu, ndị na-ahụ maka nchekwa efu, JIT na nkwalite n'ụdị sistemu, njikwa njehie, na nkwụsi ike.

N'ime nkuzi a, ị ga-amụta Otu esi etinye PHP 8.0 na Rocky Linux 8.

Prerequisites

  • OS akwadoro: Rocky Linux 8.+.
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ma ọ bụ ohere mgbọrọgwụ.
  • Ngwungwu achọrọ: ebe nchekwa

Melite Sistemụ Ọrụ

Melite gi Nkume linux Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo dnf upgrade --refresh -y

Nkuzi a ga-eji ya sudo iwu na na-eche na ị nwere ọnọdụ sudo.

Iji nyochaa ọkwa sudo na akaụntụ gị:

sudo whoami

Ihe atụ na-egosi ọkwa sudo:

[joshua@rockylinux ~]$ sudo whoami
root

Ka ịtọlite ​​akaụntụ sudo dị adị ma ọ bụ ọhụrụ, gaa na nkuzi anyị na Otu esi etinye onye ọrụ na Sudoers na Rocky Linux.

Iji mgbọrọgwụ akaụntụ, jiri iwu na-esonụ na paswọọdụ mgbọrọgwụ banye.

su

Advertisement


Wụnye ebe nchekwa PHP 8.0 Remi

Ugbu a, PHP 8.0 adịghị egosipụta na Rocky Linux's AppStream, ebe ọ bụ na ọ ka dị ọhụrụ ma na-edozibeghị agbụ ahụ na ebe nchekwa Rhel. Agbanyeghị, ịnwere ike ịwụnye PHP site na ebe nchekwa (Remi), ebe nchekwa nke ndị ọzọ na-ebuga PHP 8.0 kacha ọhụrụ yana gụnyere PHP 8.1 na-abata.

Ọrụ mbụ bụ ịwụnye ihe (EPEL) ebe nchekwa, nke na-anọchi anya (Ngwunye mgbakwunye maka Linux Enterprise). Maka ndị ọrụ ọhụrụ na Rhel na Rocky Linux, EPEL nwere ngwugwu ngwanrọ a na-ejikarị maka Linux Enterprise.

Iji tinye EPEL, jiri ihe ndị a (dnf) iwu ọnụ:

sudo dnf install epel-release

Ihe atụ mmepụta:

Otu esi etinye PHP 8.0 na Rocky Linux 8

ụdị "Y," wee pịa "Tinye igodo" ịga n'ihu na nwụnye.

Ugbu a ị gbakwunyela ebe nchekwa EPEL, gbanye (Nchekwa Remi) ya na ndi a:

sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm

Ihe atụ mmepụta:

Otu esi etinye PHP 8.0 na Rocky Linux 8

ụdị "Y," wee pịa "Tinye igodo" ịga n'ihu na nwụnye.

Ọzọ, jiri (dnf) iwu ka imelite ndepụta nchekwa gị:

sudo dnf update

Ị ga-ahụ ajụjụ n'ọnụ ọnụ gị gbasara ibubata ihe ( igodo GPG) maka ebe nchekwa Remi dị ka n'okpuru:

Otu esi etinye PHP 8.0 na Rocky Linux 8

ụdị "Y," wee pịa "Tinye igodo" ka gaba n'ihu na mbubata igodo GPG na imecha nrụnye.

Mara, ị ga-abịa ngwa ngwa x2 ọtụtụ ugboro iji pịnye "Y" ibubata igodo GPG ọzọ. Nke a dị mma ime.

Kwado ebe nchekwa PHP 8.0 (Remi).

PHP 7.2 bụ nhọrọ PHP ndabara maka nrụnye ọkọlọtọ na Rhel/Rocky Linux yana ebe nchekwa Remi. Ndụmọdụ dị ngwa bụ iji (depụta php) iwu ịhụ nhọrọ dị na ndabara. Iwu a nwere ike ime nke a:

sudo dnf module list php

Ị ga-enweta ihe mmepụta dị ka n'okpuru. Rịba ama (d) mkpado maka ndabere PHP ka etinyere:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Dịka ị nwere ike ịhụ n'elu, na (d) mkpado dị n'akụkụ PHP 7.2, nke ị ga-achọ ịtọgharịa ma gbanwee iji wụnye PHP 8.0 na Rocky Linux.

Ịtọgharịa ndepụta PHP dị mfe site na iwu a:

sudo dnf module list reset php

Na-esote, mee ka PHP 8.0 jiri iwu a:

sudo dnf module enable php:remi-8.0 -y

Ihe atụ mmepụta:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Advertisement


Tinye PHP 8.0

Ugbu a ị gbakwunyela ebe nchekwa PHP Remi wee mee ka PHP 8.0 bụrụ ụdị ndabara na sistemụ Rocky Linux gị, ị nwere ike iwunye PHP 8.0 site na iwu a:

sudo dnf install php

Ihe atụ mmepụta:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Ọ bụrụ n’ịchọrọ ịwụnye ndọtị ndị a na-ejikarị maka PHP 8.0, jiri iwu a:

sudo dnf install php-cli php-fpm php-curl php-mysqlnd php-gd php-opcache php-zip php-intl php-common php-bcmath php-imap php-imagick php-xmlrpc php-json php-readline php-memcached php-redis php-mbstring php-apcu php-xml

Mara, wepụ nhọrọ ndị ị na-achọghị nke a bụ nhọrọ. Maka ntuziaka ahụ, anyị rụnyere nza niile dịka n'okpuru:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Ugbu a ị tinyela PHP 8.0 na mgbakwunye na-elele ụdị ahụ site na iwu a:

php -v

Ihe atụ n'okpuru, cheta na nke a ga-agbanwe n'oge:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Ntinye PHP-FPM nke PHP 8.0

N'adịghị ka nrụnye PHP-FPM na Debian/Ubuntu na-eji (www-data) onye ọrụ, nke a abụghị ikpe maka nrụnye ezinụlọ RHEL. Site na ndabara na AlmaLinux, a haziri ọrụ PHP-FPM ka a na-agba ya (apache) onye ọrụ, nke ezighi ezi ebe ọ bụ na anyị na-eji Nginx, nke a kwesịrị ka edozi ya.

Nke mbụ, meghere ndị a (www.conf) nhazi faịlụ:

sudo nano /etc/php-fpm.d/www.conf

Na-esote, dochie (apache) onye ọrụ na otu na (Nginx) onye ọrụ na otu:

Otu esi etinye PHP 8.0 na Rocky Linux 8

Ka ịchekwaa, pịa (CTRL+O) wee pụọ (CTRL+X).

Ugbu a, ị ga-ebugharị ma ọ bụ malitegharịa ọrụ PHP-FPM gị:

sudo systemctl restart php-fpm

Advertisement


Okwu na mmechi

N'ime nkuzi a, ị mụtala banyere nke (EPEL) ebe nchekwa na (Remi) ebe nchekwa na otu esi etinye ha na sistemụ Rocky Linux gị, yana ịwụnye PHP 8.0 site na ebe nchekwa ndị ahụ. N'ozuzu, PHP 8.0 na-amalite ugbu a ịghọ ọkọlọtọ mara mma n'ebe niile. Site na mmepe nke PHP 8.1 na-abịa, ndị mmepe na-emezi ngwa weebụ ha PHP 8 enyi na enyi, gụnyere nnukwu CMS WordPress nwere isiokwu ndị ọzọ na ngwa mgbakwunye devs iji nweta PHP 8.0 akwadoro nyere uru 8 nwere na nchekwa na ọsọ tụnyere 7. usoro.

Agbanyeghị, naanị ị ga-etinye PHP 8.0 ma ọ bụrụ na ịmara na ngwanrọ gị na-akwado ya, n'ihi na ọ ga-ebute nsogbu na ngwa gị, yabụ gbaa mbọ lelee. Ọ bụrụ na ị maara ka esi etinye Rocky Linux 8, lelee ntuziaka anyị maka ịwụnye Nkume Linux 8.

Ahapụ a Comment