Install PHP 8 on OpenSUSE

This guide will take you through how to install PHP 8 on OpenSUSE. PHP is a popular general-purpose scripting language with a focus on web development. It was one of the first server-side languages to be integrated into HTML, making it simple to add functionality to websites without requiring data from separate files. PHP is a fast, flexible, and pragmatic programming language that powers anything from your blog to the world’s most popular websites.

How to Install PHP 8 on OpenSUSE

  • Update your packages.
sudo zypper update
  • Install PHP 8 using the following command.
sudo zypper install php8

Sample output

Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 8 recommended packages were automatically selected:
  php8-ctype php8-dom php8-iconv php8-openssl php8-sqlite php8-tokenizer
  php8-xmlreader php8-xmlwriter

The following 4 packages are suggested, but will not be installed:
  php8-gd php8-gettext php8-mbstring php8-mysql

The following 11 NEW packages are going to be installed:
  php8 php8-cli php8-ctype php8-dom php8-iconv php8-openssl php8-pdo
  php8-sqlite php8-tokenizer php8-xmlreader php8-xmlwriter

11 new packages to install.
Overall download size: 2.6 MiB. Already cached: 0 B. After the operation,
additional 9.0 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package php8-cli-8.1.7-1.1.x86_64
                                        (1/11),   2.0 MiB (  8.1 MiB unpacked)
Retrieving: php8-cli-8.1.7-1.1.x86_64.rpm ................[done (349.1 KiB/s)]
Retrieving package php8-8.1.7-1.1.x86_64
                                        (2/11),  70.2 KiB (147.8 KiB unpacked)
Retrieving: php8-8.1.7-1.1.x86_64.rpm ....................[done (120.4 KiB/s)]
Retrieving package php8-dom-8.1.7-1.1.x86_64
                                        (3/11),  91.1 KiB (200.4 KiB unpacked)
Retrieving: php8-dom-8.1.7-1.1.x86_64.rpm ................[done (118.4 KiB/s)]
Retrieving package php8-ctype-8.1.7-1.1.x86_64
                                        (4/11),  30.9 KiB ( 14.5 KiB unpacked)
Retrieving: php8-ctype-8.1.7-1.1.x86_64.rpm ............................[done]
Retrieving package php8-iconv-8.1.7-1.1.x86_64
                                        (5/11),  45.8 KiB ( 51.0 KiB unpacked)
Retrieving: php8-iconv-8.1.7-1.1.x86_64.rpm ................[done (2.7 KiB/s)]
Retrieving package php8-openssl-8.1.7-1.1.x86_64
                                        (6/11),  98.3 KiB (218.5 KiB unpacked)
Retrieving: php8-openssl-8.1.7-1.1.x86_64.rpm ..........................[done]
Retrieving package php8-pdo-8.1.7-1.1.x86_64
                                        (7/11),  72.2 KiB (123.7 KiB unpacked)
Retrieving: php8-pdo-8.1.7-1.1.x86_64.rpm ..................[done (2.7 KiB/s)]
Retrieving package php8-sqlite-8.1.7-1.1.x86_64
                                        (8/11),  58.5 KiB (102.8 KiB unpacked)
Retrieving: php8-sqlite-8.1.7-1.1.x86_64.rpm ...............[done (2.7 KiB/s)]
Retrieving package php8-tokenizer-8.1.7-1.1.x86_64
                                        (9/11),  38.6 KiB ( 34.8 KiB unpacked)
Retrieving: php8-tokenizer-8.1.7-1.1.x86_64.rpm ............[done (2.8 KiB/s)]
Retrieving package php8-xmlreader-8.1.7-1.1.x86_64
                                       (10/11),  40.3 KiB ( 39.0 KiB unpacked)
Retrieving: php8-xmlreader-8.1.7-1.1.x86_64.rpm ............[done (2.7 KiB/s)]
Retrieving package php8-xmlwriter-8.1.7-1.1.x86_64
                                       (11/11),  39.9 KiB ( 51.0 KiB unpacked)
Retrieving: php8-xmlwriter-8.1.7-1.1.x86_64.rpm ...........[done (45.7 KiB/s)]

Checking for file conflicts: ...........................................[done]
( 1/11) Installing: php8-cli-8.1.7-1.1.x86_64 ..........................[done]
( 2/11) Installing: php8-8.1.7-1.1.x86_64 ..............................[done]
( 3/11) Installing: php8-dom-8.1.7-1.1.x86_64 ..........................[done]
( 4/11) Installing: php8-ctype-8.1.7-1.1.x86_64 ........................[done]
( 5/11) Installing: php8-iconv-8.1.7-1.1.x86_64 ........................[done]
( 6/11) Installing: php8-openssl-8.1.7-1.1.x86_64 ......................[done]
( 7/11) Installing: php8-pdo-8.1.7-1.1.x86_64 ..........................[done]
( 8/11) Installing: php8-sqlite-8.1.7-1.1.x86_64 .......................[done]
( 9/11) Installing: php8-tokenizer-8.1.7-1.1.x86_64 ....................[done]
(10/11) Installing: php8-xmlreader-8.1.7-1.1.x86_64 ....................[done]
(11/11) Installing: php8-xmlwriter-8.1.7-1.1.x86_64 ....................[done]
  • Check version.
php -v
  • Search for available PHP 8 extensions using the command below.
zypper search php8

Sample output

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

S  | Name             | Summary                                                   | Type
---+------------------+-----------------------------------------------------------+--------
   | apache2-mod_php8 | PHP module for the Apache 2.x webserver                   | package
i+ | php8             | Interpreter for the PHP scripting language version 8      | package
   | php8-APCu        | APCu - APC User Cache                                     | package
   | php8-bcmath      | "Binary Calculator" extension for PHP                     | package
   | php8-bz2         | PHP bzip2 codec support                                   | package
   | php8-calendar    | PHP Extension Module                                      | package
i  | php8-cli         | Interpreter for the PHP scripting language version 8      | package
i  | php8-ctype       | Character class extension for PHP                         | package
   | php8-curl        | PHP libcurl integration                                   | package
   | php8-dba         | Database abstraction layer for PHP                        | package
   | php8-devel       | PHP development files for C/C++ extensions                | package
i  | php8-dom         | Document Object Model extension for PHP                   | package
   | php8-embed       | Embedded SAPI Library                                     | package
   | php8-enchant     | Spell checking extension for PHP                          | package
   | php8-exif        | EXIF metadata extensions for PHP                          | package
   | php8-fastcgi     | FastCGI PHP Module                                        | package
   | php8-ffi         | Main interface to C code and data                         | package
   | php8-fileinfo    | File identification extension for PHP                     | package
   | php8-fpm         | FastCGI Process Manager PHP Module                        | package
   | php8-fpm-apache  | Apache configuration for PHP-FPM                          | package
   | php8-ftp         | FTP protocol support for PHP                              | package
   | php8-gd          | GD Graphics Library extension for PHP                     | package
   | php8-gettext     | Native language support for PHP                           | package
   | php8-gmagick     | Wrapper to the GraphicsMagick library                     | package
   | php8-gmp         | Bignum extension for PHP                                  | package
   | php8-ice         | PHP framework delivered as C extension                    | package
i  | php8-iconv       | Character set conversion functions for PHP                | package
   | php8-imagick     | Wrapper to the ImageMagick library                        | package
   | php8-intl        | ICU integration for PHP                                   | package
   | php8-ldap        | LDAP protocol support for PHP                             | package
   | php8-lzf         | LZF compression                                           | package
   | php8-maxminddb   | PHP extension providing access to maxminddb databases     | package
   | php8-mbstring    | Multibyte string functions for PHP                        | package
   | php8-memcache    | PHP Memcache client Extension                             | package
   | php8-memcached   | PHP MemcacheD client Extension                            | package
   | php8-mysql       | MySQL database client for PHP                             | package
   | php8-odbc        | ODBC extension for PHP                                    | package
   | php8-opcache     | Opcode cache extension for PHP                            | package
i  | php8-openssl     | OpenSSL integration for PHP                               | package
   | php8-pcntl       | Process Control extension for PHP                         | package
i  | php8-pdo         | PHP Data Objects extension for PHP                        | package
   | php8-pear        | PHP Extension and Application Repository                  | package
   | php8-pecl        | PHP Extension Community Library                           | package
   | php8-pgsql       | PostgreSQL database client for PHP                        | package
   | php8-phar        | PHP Archive extension for PHP                             | package
   | php8-posix       | POSIX functions for PHP                                   | package
   | php8-psr         | PSR Extension Module                                      | package
   | php8-readline    | PHP readline extension                                    | package
   | php8-redis       | API for communicating with Redis servers                  | package
   | php8-shmop       | Alternate, low-level shared memory implementation for PHP | package
   | php8-smbclient   | A PHP wrapper for libsmbclient                            | package
   | php8-snmp        | SNMP extension for PHP                                    | package
   | php8-soap        | SOAP/WSDL extension module for PHP                        | package
   | php8-sockets     | Berkeley sockets API for PHP                              | package
   | php8-sodium      | Cryptographic Extension Based on Libsodium                | package
i  | php8-sqlite      | SQLite database client for PHP                            | package
   | php8-sysvmsg     | SysV Message Queue support for PHP                        | package
   | php8-sysvsem     | SysV Semaphore support for PHP                            | package
   | php8-sysvshm     | SysV Shared Memory support for PHP                        | package
   | php8-test        | Interpreter for the PHP scripting language version 8      | package
   | php8-tidy        | PHP binding for the Tidy HTML cleaner                     | package
i  | php8-tokenizer   | Extension module to access Zend Engine's PHP tokenizer    | package
   | php8-uuid        | PHP UUID support functions                                | package
   | php8-xdebug      | Extended PHP debugger                                     | package
i  | php8-xmlreader   | Streaming XML reader extension for PHP                    | package
i  | php8-xmlwriter   | Streaming-based XML writer extension for PHP              | package
   | php8-xsl         | PHP Extension Module                                      | package
   | php8-zip         | ZIP archive support for PHP                               | package
   | php8-zlib        | Zlib compression support for PHP                          | package
  • To install a specific package, run the command below followed by the package name e.g. ice
sudo zypper install php8-ice
  • You can also install multiple packages as shown below.
sudo zypper install php8-{curl,imagick,fpm,bz2}
  • You have reached the end of our article, congratulations. We have gone through how to install PHP 8 on OpenSUSE.

Read more on PHP Documentation

Other Tutorials

Install PHP 7.4 on Ubuntu 18.04

Install phpMyAdmin on Ubuntu 22.04

Install PHP 7.4 on CentOS 7

System administrator | Software Developer | DevOps

Leave a Comment