Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

PHP 8.0 se yon aktyalizasyon enpòtan nan lang PHP ki te pibliye nan dat 26 novanm 2020, yon gwo pwogrè nan vèsyon PHP 7.4 ki egziste deja. Nouvo PHP a gen anpil nouvo karakteristik ak optimize, ki gen ladan agiman nonmen, kalite sendika, atribi, pwomosyon pwopriyete konstrukteur, ekspresyon matche ak, operatè san danje, JIT ak amelyorasyon nan sistèm tip, manyen erè, ak konsistans.

Nan leson patikilye sa a, ou pral aprann ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap.

Kondisyon

Mizajou sistèm operasyon

Mete ajou ou openSUSE sistèm operasyon pou asire tout pakè ki egziste deja yo ajou:

sudo zypper refresh -y

Tutorial la pral sèvi ak la sudo kòmand ak sipoze ou gen estati sudo.

Pou verifye estati sudo sou kont ou:

sudo whoami

Egzanp pwodiksyon ki montre estati sudo:

[joshua@opensuse ~]$ sudo whoami
root

Pou mete kanpe yon kont sudo ki deja egziste oswa nouvo, vizite leson patikilye nou an sou ajoute yon itilizatè nan Sudoers sou openSUSE.

Pou itilize kont rasin, sèvi ak lòd sa a ak modpas rasin lan pou konekte.

su

reklam


Enpòte ak enstale ekstansyon PHP

Premye travay la se enstale server:php:extensions nan tèminal openSUSE ou a. Sepandan, depann de vèsyon openSUSE w ap kouri kounye a, sa ka varye. Anba a se de egzanp dènye ak anvan yo nan openSUSE Leap.

Enpòte server:php:extensions pou openSUSE Leap 15.3:

sudo zypper addrepo https://download.opensuse.org/repositories/home:/Padom/15.3/home:Padom.repo

Enpòte server:php:extensions pou openSUSE Leap 15.2:

sudo zypper addrepo https://download.opensuse.org/repositories/server:php:extensions/openSUSE_Leap_15.2/server:php:extensions.repo

Enpòte server:php:extensions pou openSUSE Leap 15.1:

sudo zypper addrepo https://download.opensuse.org/repositories/server:php:extensions/openSUSE_Leap_15.1/server:php:extensions.repo

Egzanp pwodiksyon enpòte 15.3:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Pou nouvo lage, swiv fòmil la. Yon fwa fè, rafrechi repozitwa a.

sudo zypper refresh

Yo pral mande w sou kle GPG la epi pou w rejte, fè konfyans tanporèman, oswa toujou.

Egzanp:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kalite "yon", Lè sa a, peze la "ENTRE BOUTON" kontinye ak enpòte kle GPG la.

Enstale PHP 8.0

Kounye a ke ou te enpòte ak enstale depo ekstansyon PHP pou sistèm openSUSE ou a, enstale PHP 8.0 ak lòd sa a.

sudo zypper install php8

Egzanp pwodiksyon:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kalite "Y", Lè sa a, peze la "ENTRE KLE" kontinye ak enstalasyon an.

Kounye a ke ou te enstale PHP 8.0 ak ekstansyon yo tcheke vèsyon an ak lòd sa a:

php -v

Egzanp pwodiksyon anba a, sonje sa a pral chanje nan tan:

PHP 8.0.11 (cli) (built: Sep 23 2021 12:00:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.11, Copyright (c) Zend Technologies

reklam


Kijan pou fè rechèch pou pakè PHP 8.0

Pa default, lè w ap enstale PHP 8.0, sèlman kèk nan pakè prensipal yo enstale. Sepandan, jan pifò abitye ak PHP ta konnen, ou ka enstale anpil siplemantè pou plizyè aplikasyon oswa kondisyon.

Pou chèche pakè adisyonèl nan depo ekstansyon PHP, sèvi ak lòd sa a nan tèminal ou a.

sudo zypper search php8

Egzanp pwodiksyon:

Loading repository data...
Reading installed packages...

S  | Name                     | Summary                                                   | Type
---+--------------------------+-----------------------------------------------------------+-----------
   | php8                     | Interpreter for the PHP scripting language version 8      | srcpackage
i+ | php8                     | Interpreter for the PHP scripting language version 8      | package
   | php8-APCu                | APCu - APC User Cache                                     | srcpackage
   | php8-APCu                | APCu - APC User Cache                                     | package
   | php8-bcmath              | "Binary Calculator" extension for PHP                     | package
   | php8-bcmath-debuginfo    | Debug information for package php8-bcmath                 | package
   | php8-bz2                 | bzip2 codec support for PHP                               | package
   | php8-bz2-debuginfo       | Debug information for package php8-bz2                    | package
   | php8-calendar            | PHP8 Extension Module                                     | package
   | php8-calendar-debuginfo  | Debug information for package php8-calendar               | package
i  | php8-cli                 | Interpreter for the PHP scripting language version 8      | package
   | php8-cli-debuginfo       | Debug information for package php8-cli                    | package
i  | php8-ctype               | Character class extension for PHP                         | package
   | php8-ctype-debuginfo     | Debug information for package php8-ctype                  | package
   | php8-curl                | libcurl integration for PHP                               | package
   | php8-curl-debuginfo      | Debug information for package php8-curl                   | package
   | php8-dba                 | Database abstraction layer for PHP                        | package
   | php8-dba-debuginfo       | Debug information for package php8-dba                    | package
   | php8-debuginfo           | Debug information for package php8                        | package
   | php8-debugsource         | Debug sources for package php8                            | package
   | php8-devel               | PHP8 development files for C/C++ extensions               | package
i  | php8-dom                 | Document Object Model extension for PHP                   | package
   | php8-dom-debuginfo       | Debug information for package php8-dom                    | package
   | php8-enchant             | Spell checking extension for PHP                          | package
   | php8-enchant-debuginfo   | Debug information for package php8-enchant                | package
   | php8-exif                | EXIF metadata extensions for PHP                          | package
   | php8-exif-debuginfo      | Debug information for package php8-exif                   | package
   | php8-fileinfo            | File identification extension for PHP                     | package
   | php8-fileinfo-debuginfo  | Debug information for package php8-fileinfo               | package
   | php8-ftp                 | FTP protocol support for PHP                              | package
   | php8-ftp-debuginfo       | Debug information for package php8-ftp                    | package
   | php8-gd                  | GD Graphics Library extension for PHP                     | package
   | php8-gd-debuginfo        | Debug information for package php8-gd                     | package
   | php8-gettext             | Native language support for PHP                           | package
   | php8-gettext-debuginfo   | Debug information for package php8-gettext                | package
   | php8-gmagick             | Wrapper to the GraphicsMagick library                     | srcpackage
   | php8-gmagick             | Wrapper to the GraphicsMagick library                     | package
   | php8-gmp                 | Bignum extension for PHP                                  | package
   | php8-gmp-debuginfo       | Debug information for package php8-gmp                    | package
   | php8-gnupg               | PHP wrapper around the gpgme library                      | srcpackage
   | php8-gnupg               | PHP wrapper around the gpgme library                      | package
   | php8-ice                 | PHP framework delivered as C extension                    | srcpackage
   | php8-ice                 | PHP framework delivered as C extension                    | package
i  | php8-iconv               | Character set conversion functions for PHP                | package
   | php8-iconv-debuginfo     | Debug information for package php8-iconv                  | package
   | php8-imagick             | Wrapper to the ImageMagick library                        | srcpackage
   | php8-imagick             | Wrapper to the ImageMagick library                        | package
   | php8-intl                | ICU integration for PHP                                   | package
   | php8-intl-debuginfo      | Debug information for package php8-intl                   | package
   | php8-ldap                | LDAP protocol support for PHP                             | package
   | php8-ldap-debuginfo      | Debug information for package php8-ldap                   | package
   | php8-lzf                 | LZF compression                                           | srcpackage
   | php8-lzf                 | LZF compression                                           | package
   | php8-maxminddb           | PHP extension providing access to maxminddb databases     | srcpackage
   | php8-maxminddb           | PHP extension providing access to maxminddb databases     | package
   | php8-mbstring            | Multibyte string functions for PHP                        | package
   | php8-mbstring-debuginfo  | Debug information for package php8-mbstring               | package
   | php8-memcache            | PHP Memcache client Extension                             | srcpackage
   | php8-memcache            | PHP Memcache client Extension                             | package
   | php8-memcached           | PHP MemcacheD client Extension                            | srcpackage
   | php8-memcached           | PHP MemcacheD client Extension                            | package
   | php8-mysql               | MySQL database client for PHP                             | package
   | php8-mysql-debuginfo     | Debug information for package php8-mysql                  | package
   | php8-odbc                | ODBC extension for PHP                                    | package
   | php8-odbc-debuginfo      | Debug information for package php8-odbc                   | package
   | php8-opcache             | Opcode cache extension for PHP                            | package
   | php8-opcache-debuginfo   | Debug information for package php8-opcache                | package
i  | php8-openssl             | OpenSSL integration for PHP                               | package
   | php8-openssl-debuginfo   | Debug information for package php8-openssl                | package
   | php8-pcntl               | Process Control extension for PHP                         | package
   | php8-pcntl-debuginfo     | Debug information for package php8-pcntl                  | package
i  | php8-pdo                 | PHP Data Objects extension for PHP                        | package
   | php8-pdo-debuginfo       | Debug information for package php8-pdo                    | package
   | php8-pear                | PHP Extension and Application Repository                  | package
   | php8-pear                | PHP Extension and Application Repository                  | srcpackage
   | php8-pecl                | PHP Extension Community Library                           | package
   | php8-pgsql               | PostgreSQL database client for PHP                        | package
   | php8-pgsql-debuginfo     | Debug information for package php8-pgsql                  | package
   | php8-phar                | PHP Archive extension for PHP                             | package
   | php8-phar-debuginfo      | Debug information for package php8-phar                   | package
   | php8-posix               | POSIX functions for PHP                                   | package
   | php8-posix-debuginfo     | Debug information for package php8-posix                  | package
   | php8-psr                 | PSR Extension Module                                      | srcpackage
   | php8-psr                 | PSR Extension Module                                      | package
   | php8-readline            | PHP8 readline extension                                   | package
   | php8-readline-debuginfo  | Debug information for package php8-readline               | package
   | php8-redis               | API for communicating with Redis servers                  | srcpackage
   | php8-redis               | API for communicating with Redis servers                  | package
   | php8-shmop               | Alternate, low-level shared memory implementation for PHP | package
   | php8-shmop-debuginfo     | Debug information for package php8-shmop                  | package
   | php8-smbclient           | A PHP wrapper for libsmbclient                            | srcpackage
   | php8-smbclient           | A PHP wrapper for libsmbclient                            | package
   | php8-snmp                | SNMP extension for PHP                                    | package
   | php8-snmp-debuginfo      | Debug information for package php8-snmp                   | package
   | php8-soap                | SOAP/WSDL extension module for PHP                        | package
   | php8-soap-debuginfo      | Debug information for package php8-soap                   | package
   | php8-sockets             | Berkeley sockets API for PHP                              | package
   | php8-sockets-debuginfo   | Debug information for package php8-sockets                | package
   | php8-sodium              | Cryptographic Extension Based on Libsodium                | package
   | php8-sodium-debuginfo    | Debug information for package php8-sodium                 | package
i  | php8-sqlite              | SQLite database client for PHP                            | package
   | php8-sqlite-debuginfo    | Debug information for package php8-sqlite                 | package
   | php8-sysvmsg             | SysV Message Queue support for PHP                        | package
   | php8-sysvmsg-debuginfo   | Debug information for package php8-sysvmsg                | package
   | php8-sysvsem             | SysV Semaphore support for PHP                            | package
   | php8-sysvsem-debuginfo   | Debug information for package php8-sysvsem                | package
   | php8-sysvshm             | SysV Shared Memory support for PHP                        | package
   | php8-sysvshm-debuginfo   | Debug information for package php8-sysvshm                | package
   | php8-tidy                | PHP8 binding for the Tidy HTML cleaner                    | package
   | php8-tidy-debuginfo      | Debug information for package php8-tidy                   | package
i  | php8-tokenizer           | Extension module to access Zend Engine's PHP tokenizer    | package
   | php8-tokenizer-debuginfo | Debug information for package php8-tokenizer              | package
   | php8-uploadprogress      | An php extension to track progress of a file upload       | srcpackage
   | php8-uploadprogress      | An php extension to track progress of a file upload       | package
   | php8-uuid                | PHP UUID support functions                                | srcpackage
   | php8-uuid                | PHP UUID support functions                                | package
   | php8-xdebug              | Extended PHP debugger                                     | srcpackage
   | php8-xdebug              | Extended PHP debugger                                     | package
i  | php8-xmlreader           | Streaming XML reader extension for PHP                    | package
   | php8-xmlreader-debuginfo | Debug information for package php8-xmlreader              | package
i  | php8-xmlwriter           | Streaming-based XML writer extension for PHP              | package
   | php8-xmlwriter-debuginfo | Debug information for package php8-xmlwriter              | package
   | php8-xsl                 | PHP8 Extension Module                                     | package
   | php8-xsl-debuginfo       | Debug information for package php8-xsl                    | package
   | php8-zip                 | ZIP archive support for PHP                               | package
   | php8-zip-debuginfo       | Debug information for package php8-zip                    | package
   | php8-zlib                | Zlib compression support for PHP                          | package
   | php8-zlib-debuginfo      | Debug information for package php8-zlib                   | package

Pou enstale ekstansyon PHP 8.0 Redis nan lis la, ou ta egzekite lòd sa a:

sudo zypper install php8-redis

Egzanp pwodiksyon:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kalite "Y", Lè sa a, peze la "ENTRE KLE" kontinye ak enstalasyon an.

Menm prensip la ka itilize pou PHP 7.4. Jis ranplase 8 la ak 7.

sudo zypper search php7

Pa default, tout pakè ki enstale ak php7 yo pral PHP 7.4.

Ki jan yo enstale PHP-FPM 8

Pa default, modil Nginx FPM pa vini natif natal nan ekstansyon PHP pa openSUSE. Pou enstale sa a, w ap bezwen enstale youn nan depo kominote yo. Youn nan rekòmande yo se Repozitwa Padom la ki nan lis kòm yon altènatif nan rechèch pakè openSUSE a.

Premyèman, w ap bezwen ajoute repozitwa respektif la.

openSUSE kwasans 15.3

sudo zypper addrepo https://download.opensuse.org/repositories/home:/Padom/15.3/home:Padom.repo

openSUSE kwasans 15.2:

sudo zypper addrepo https://download.opensuse.org/repositories/home:Padom/openSUSE_Leap_15.2/home:Padom.repo

openSUSE kwasans 15.1:

sudo zypper addrepo https://download.opensuse.org/repositories/home:Padom/openSUSE_Leap_15.1/home:Padom.repo

Rafrechi depo a, epi aksepte enpòte GPG nan depo ou chwazi a.

sudo zypper refresh

Apre sa, enstale ekstansyon Nginx PHP-FPM 8 la.

sudo zypper install php8-fpm

Yo pral mande w sou kle GPG la epi pou w rejte, fè konfyans tanporèman, oswa toujou.

Egzanp pwodiksyon:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kalite "yon", Lè sa a, peze la "ENTRE BOUTON" kontinye ak enpòte kle GPG la.

Egzanp pwodiksyon:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kalite "Y", Lè sa a, peze la "ENTRE KLE" kontinye ak enstalasyon an.

Yon fwa enstale, kopye dosye konfigirasyon default yo nan non respektif yo.

Si w pa fè sa, sa pral lakòz PHP-FPM bay yon estati erè.

sudo cp /etc/php8/fpm/php-fpm.conf.default /etc/php8/fpm/php-fpm.conf
sudo cp /etc/php8/fpm/php-fpm.d/www.conf.default /etc/php8/fpm/php-fpm.d/www.conf

Koulye a, pa default, PHP-FPM enfim. Pou pèmèt PHP FPM pou itilize kòmandman sa a.

sudo systemctl enable php-fpm --now

Apre sa, konfime PHP-FPM ap travay kòrèkteman.

sudo systemctl status php-fpm

Egzanp pwodiksyon:

Ki jan yo enstale PHP 8.0 sou openSUSE 15 Leap

Kòm pi wo a, PHP-FPM ap travay kòrèkteman epi yo pral mete ajou lè l sèvi avèk depo kominote a. Altènativman, ou ka enstale tout ekstansyon PHP 8 ou soti nan repozitwa sa a. Li trè konsidere epi, menm jan ak FPM te ajoute, gen plis ekstansyon pase depo ofisyèl la.


reklam


Kòmantè ak konklizyon

Nan leson patikilye a, ou te aprann ki jan yo enpòte depo ekstansyon PHP pou vèsyon ou nan openSUSE epi enstale pakè adisyonèl epi chèche yo. An jeneral, PHP 8.0 kounye a kòmanse vin trè estanda toupatou.

Avèk devlopman PHP 8.1 k ap vini an, plis devlopè yo ap fè aplikasyon pou entènèt PHP 8 zanmitay, ki gen ladan WordPress CMS jeyan ki gen plis tèm ak devlopè plugin kous pou jwenn PHP 8.0 sipòte bay avantaj 8 genyen nan sekirite ak vitès konpare ak 7 la. seri.

Ban-m pran abònman
Notifye nan
4 kòmantè
Aliye komantè
Wè tout kòmantè

ki jan enstale fpm

PHP Repo san fpm oswa modil apache, yon ti kras initil jiskaprezan

4
0
Ta renmen panse ou, tanpri fè kòmantè.x