How to Install PHP 7.3 on Fedora 28/29/30

How to Install PHP 7.3 on Fedora 28/29/30
How to Install PHP 7.3 on Fedora 28/29/30

Install PHP 7.3 on Fedora 29

PHP is the server-side scripting language used for web development. PHP has different versions 5.6, 7.0, 7.1, 7.2 and 7.3 etc. Currently, PHP 7.3 is the latest version of PHP. CentOS 7 official repository supports PHP 5.4 which will no longer receive any updates. To get the latest security updates and features you need to migrate to PHP 7.3. In this tutorial you will learn how to install PHP 7.3 on Fedora 29.

Prerequisites

Before you start installing PHP 7.3 on Fedora 29. You must have the non-root user account on your server with sudo privileges.

1. Installing PHP 7.3 on Fedora 29

As PHP 7.3 is available in Fedora global repository. You will need to enter following text in terminal.

sudo dnf -y install php

Confirm installation of PHP 7.3.

php7 -v

Output should be:

# php73 -v
    PHP 7.3.1 (cli) (built: Apr 30 2019 02:02:51) ( NTS )
    Copyright (c) 1997-2019 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2019 Zend Technologies
    with Zend OPcache v7.3.1, Copyright (c) 1999-2019, by Zend Technologies

2. Installing PHP 7.3 on Fedora 29

As PHP 7.3 is not available in Fedora global repository. You will need to add it manually.
To Enable PHP 7.3 in Fedora repository enter following text in terminal.

sudo dnf install -y  http://rpms.remirepo.net/fedora/remi-release-29.rpm

Now enable Remi Repositories for PHP 7.3 entering following command.

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --set-enabled remi-php73
sudo dnf config-manager --set-enabled remi

Install PHP 7.3 by typing the following text.

sudo dnf module install php:remi-7.3

Confirm installation of PHP 7.3.

php -v

Output should be:

# php -v
    PHP 7.3.1 (cli) (built: Apr 30 2019 02:13:51) ( NTS )
    Copyright (c) 1997-2019 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2019 Zend Technologies
    with Zend OPcache v7.3.1, Copyright (c) 1999-2019, by Zend Technologies

2. Installing PHP 7.3 on Fedora 28

As PHP 7.3 is not available in Fedora global repository. You will need to add it manually.
To Enable PHP 7.3 in Fedora repository enter following text in terminal.

sudo dnf install -y  http://rpms.remirepo.net/fedora/remi-release-28.rpm

Now enable Remi Repositories for PHP 7.3 entering following command.

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --set-enabled remi-php73
sudo dnf config-manager --set-enabled remi

Install PHP 7.3 by typing the following text.

sudo dnf module install php:remi-7.3

Confirm installation of PHP 7.3.

php -v

Output should be:

# php -v
    PHP 7.3.1 (cli) (built: Apr 30 2019 02:22:41) ( NTS )
    Copyright (c) 1997-2019 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2019 Zend Technologies
    with Zend OPcache v7.3.1, Copyright (c) 1999-2019, by Zend Technologies

4. Install PHP Extensions

You will need to install some basic PHP extensions to run WordPress, Ghost etc. frameworks on the server. To install any of the PHP extensions on the server following is the basic format

sudo dnf -y install php-[name_of_the_extension]

You can install curl extension for PHP by running following command.

sudo dnf -y install php-curl

Following are some basic PHP extensions needs to be installed on your server.

sudo dnf -y install php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

To install more extensions you can use the given format.

3. Testing PHP processing

To test PHP is configured on your server properly or not you should create a file test.php inside directory var/www/html/ with following code.

<?php
    phpinfo();

If you see the following output at https://YOUR_DOMAIN_NAME/test.php or https://IP_ADDRESS /test.php then you have installed PHP successfully.

Conclusion

You have successfully learned how to install PHP 7.3 on Fedora 28/29/30 with some of its basic extensions and tested. If you have any of the queries regarding this then don’t forget to comment below.

LEAVE A REPLY

Please enter your comment!
Please enter your name here