Friday, January 17, 2020

Howto install PHP 7 on Centos 7

The Centos Linux 7 comes with php version 5.4.16. It is possible to install php version 7 by adding an additional rpm repository. Lets see how its done to install php 7.3 (which is the version I have chosen).

Step 1: Add Remi repository for php 7.3


sudo yum install yum-utils
sudo yum install epel-release
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php73

Step 2: Install php


sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-json php-mysql php-mbstring

Step 3: Verify 

php --version

For the web server to accept php, it needs to be restarted.

Specialised development environment will require additional php extensions. For example laravel framework could require;

opcache, bz2, calendar, ctype, curl, dom, exif, fileinfo, ftp, gd, gettext, iconv, mysqlnd, pdo, phar, posix, shmop, simpleexml, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlwriter, xsl, mcrypt, mysqli, pdo_mysqli, wddx, xmlrender, zip.

and the list continues.

No comments:

Blog Archive