How to install PHP 7.4 on OpenSUSE 15.1?

Windows Articles

How to Install APK file on Android

Hello Friends! Today we bring you a simple guide on how to install an APK file in Android. What...

How to Install the Latest version of FFmpeg on Ubuntu 20.04 / Debian 10?

Knowing how to install the latest version of FFmpeg is important if you know how to work with multimedia files. So in...

How to block emails from specific senders in Outlook

Hello, how are you? Today we will talk a little about Microsoft Outlook. It is well known that its main function is...

How to Block a phone number on Android

Hello friends. In this post, we will show you how to block a phone number on Android. Have you ever wondered how...

How to install Java 15 on CentOS 8 / CentOS 7

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...
angeloma
angeloma
Senior Writer and partner

A new version of PHP has come out and it’s time to install it on our servers. So in this post, you will learn how to install PHP 7.4 on OpenSUSE 15.1. Having this version, you will be able to take better advantage of running websites.

As we know, PHP is a programming language widely used all over the world. In fact, most of the web sites and applications use it. Therefore, it is to be assumed that most servers need it. So it is a good idea to install the latest stable version of it.

We already know that OpenSUSE is a solid and stable rock. But a lot of this is due to the testing process they do on the packages. The problem is that the versions of the packages are frozen and as time goes by they get old.

So, let us start.

Install PHP 7.4 on OpenSUSE 15.1

Installing Apache web server

So let’s get to work.

First, I’m going to install Apache web server to have a server to run PHP 7.4 on.

So, open a new terminal session and run the following:

:~$ sudo zypper in apache2

And then we proceed to start the service:

:~$ sudo systemctl enable apache2
:~$ sudo systemctl start apache2

After this, a new rule must be set in the firewall so that it can run without problems.

:~$ sudo firewall-cmd --add-port=80/tcp --permanent
success
:~$ sudo firewall-cmd --reload
success

With this Apache will be working properly.

Installing PHP 7.4

PHP 7.4 is available to OpenSUSE using an official repository called Devel. This repository in turn contains many tools for programming, such as languages and more. Within this repository there is a special one for PHP. This is the one we will use.

So add it with the following command:

:~$ sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/php/openSUSE_Leap_15.1/ php
1.- Adding the PHP repository for OpenSUSE 15.1
1.- Adding the PHP repository for OpenSUSE 15.1

After it has been added, it sets a lower priority for packages to be downloaded from this repository. Do this with the following command:

:~$ zypper mr -p 70 php
2.- Set a lower priority to the PHP repository
2.- Set a lower priority to the PHP repository

The next step is to refresh all the repositories. When you first use this repository, it will ask you to accept the GPG key.

:~$ sudo zypper refresh
3.- accept the repository GPG key
3.- accept the repository GPG key

Then you can install PHP 7.4 on OpenSUSE 15.1 as well as some of the main PHP modules.

:~$ sudo zypper in php7 php apache2-mod_php7 php7-curl php7-xmlreader php7-zip php7-pdo php7-gd php7-json php7-mysql php7-mbstring php7-openssl
4.- Install PHP 7.4 on OpenSUSE 15.1
4.- Install PHP 7.4 on OpenSUSE 15.1

Now, enable PHP 7 on Apache and restart it.

:~$ sudo a2enmod php7
:~$ sudo systemctl restart apache2

Now, let us test it.

Create a file called test.php in /srv/www/htdocs/ and add the following:

:~$ sudo nano /srv/www/htdocs/test.php
<?php
phpinfo();
?>

Save the changes and close the file.

Then, open your favorite web browser and go to http://your-server/test.php and you will see the following:

5.- PHP 7.4 on OpenSUSE 15.1
5.- PHP 7.4 on OpenSUSE 15.1

As you can see in the image PHP 7.4 is installed and working correctly.

So, enjoy it.

Conclusion

Having PHP 7.4 is a good alternative to improve the performance of our web applications created with this language. And now we know how to do it with OpenSUSE 15.1, what remains is that you can take advantage of all these improvements of the language.

If you want to know all the news of this new version I invite you to read them in this link.

More articles

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to Install APK file on Android

Hello Friends! Today we bring you a simple guide on how to install an APK file in Android. What...

How to Install the Latest version of FFmpeg on Ubuntu 20.04 / Debian 10?

Knowing how to install the latest version of FFmpeg is important if you know how to work with multimedia files. So in...

How to block emails from specific senders in Outlook

Hello, how are you? Today we will talk a little about Microsoft Outlook. It is well known that its main function is...

How to Block a phone number on Android

Hello friends. In this post, we will show you how to block a phone number on Android. Have you ever wondered how...

How to install Java 15 on CentOS 8 / CentOS 7

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...
x