How to Install PHP 8.0/8.1 on Fedora 35 / Fedora 34 | Holhol24

7

PHP is an open-source, general-purpose scripting language principally utilized in internet construction however has additionally been used as a general-purpose programming language.

In this submit, we can see tips on how to set up PHP 8.0/8.1 on Fedora 35 / Fedora 34.

Add PHP 8.0/8.1 Repository on Fedora 35

By default, Fedora 35 and Fedora 34 include PHP v8.0 and PHP v7.4, respectively. To set up PHP 8.1 on Fedora 35 / 34, you wish to have to arrange the REMI repository that gives other variations of PHP programs for the Fedora working device.

To set up PHP v8.0 on Fedora 35, you don’t want to arrange the REMI repository.

# For PHP 8.1 on Fedora 35

sudo dnf -y set up http://rpms.remirepo.web/fedora/remi-release-35.rpm

# For PHP 8.0/8.1 Fedora 34

sudo dnf -y set up http://rpms.remirepo.web/fedora/remi-release-34.rpm

Install PHP 8.0/8.1 on Fedora 35

Now, set up PHP v8.0/8.1 with the dnf command.

# PHP 8.1 on Fedora 35

sudo dnf module allow -y php:remi-8.1
sudo dnf set up -y php php-common php-cli

# PHP 8.0 on Fedora 35 

sudo dnf set up -y php php-common php-cli

# PHP 8.1 on Fedora 34

sudo dnf module allow -y php:remi-8.1
sudo dnf set up -y php php-common php-cli

# PHP 8.0 on Fedora 34

sudo dnf module allow -y php:remi-8.0
sudo dnf set up -y php php-common php-cli

Check PHP Version

After putting in PHP, use the under command to test its model.

php -v

Output:

PHP 8.0.9 (cli) (constructed: Jul 30 2021 13:09:45) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
with Zend OPcache v8.0.9, Copyright (c), by way of Zend Technologies

Install PHP Extensions on Fedora 35

PHP extensions permit builders to increase the features of the PHP language. At their most straightforward, extensions may give further capability that isn’t natively present in PHP (equivalent to multi-threading).

For instance, putting in a PHP MySQL extension will give a boost to your code to hook up with the MySQL database.

PHP extension programs are normally named php.

To set up MySQL give a boost to for PHP v8.0, you’ll set up the php8.0-mysql package deal.

sudo dnf set up -y php-mysql

Once you could have put in a required extension, use the under command to make sure it.

php -m | grep -i mysql

Output:

mysql
mysqli
mysqlnd
pdo_mysql

Conclusion

That’s All. I am hoping you could have discovered tips on how to set up PHP 8.0/8.1 on Fedora 35 / Fedora 34.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More