PHP (was Personal Home Page, now Hypertext Preprocessor) is programming language that focuses on automateizing the server and includes the inside LAMP (Linux, Apache, MySQL, PHP) Stack which is usually used for :
- Writing script for Servers-side,
- Writing script command line,
- Writing desktop applications.
PHP can be used in leading operating systems such as Linux (Debian, Mandriva, Vedora, etc.), Unix variants (HP-UX, Solaris OpenBSD), Microsoft Windows, MacOS, RISC OS, and so forth. Before starting writing the PHP script, it is required to do the PHP installation on your own OS. Here is a step to perform the PHP installation on the CentOS operating system.
How to Install PHP 7.x on CentOS 7 Operations System
Here are steps to the PHP installation version 7.1, 7.2, 7.3 and 7.4 on os CentOS 7.
Step 1: Install yum-utils and enable EPEL repository
- Log in into the server and run command yum to install yum-utils & enable repository epple
[root@faiz ~]# yum install epel-release yum-utils -y
Step 2: Download and Install remirepo
[root@faiz ~]# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Step 3: The PHP 7x repository configuration is as desired
- Repository configuration for your PHP with syntax
[root@faiz ~]# yum-config-manager --enable remi-php7<x>
with <x> =
- 1 for the PHP 7.1 repository
- 2 for the PHP 7.2 repository
- 3 for the PHP 7.3 repository
- 4 for the PHP 7.4 repository
Step 4: Install PHP 7.x with dependencyshis
- On this step, installed PHP is PHP 7.4 with some modules
[root@faiz ~]# yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql -y
Make sure download the module you need for your programming script. All modules that can be used for PHP can be seen with syntax
[root@faiz ~]# yum search php | more
Step 5: Recheck and verify PHP version
- When step 4) is already installed, use syntax
[root@faiz ~]# php -v
to recheck version of installed PHP
After installing a PHP, you can start to write a PHP script on Script Editor Your favorite and immediate execution of the script. Happy programming.