Wednesday, July 5, 2017

Linux: Install PHP7 on Fedora 25 Server Edition

1. We need to download remi repo to our fedora system. Here in this example, I'm using wget to get the file from remi repo but if you have access to ftp of fedora, you can download to your host operating system and transfer the rpm file to the tilde directory (root@localhost ~) of fedora. Take note that if you are under proxy server, you need to alter the file in /etc/wgetrc and enable http proxy, https proxy and ftp proxy by removing the semicolon before the words. After installing our remi repo list, we need to update our system so that the system knows our repo list. 

wget http://rpms.remirepo.net/fedora/remi-release-25.rpm


dnf install remi-release-25.rpm


dnf install dnf-plugins-core
dnf config-manager --set-enabled remi-php71

dnf update

2. Install PHP7 and PHP7 modules on REMI REPO list.  In this example, we force dnf or the shorter term of dandified yum to install PHP7 in your remi repo list. We also need to install PHP module like mysql module, pgsql module if you are using postgresql, fpm module, mcrypt module and others.

dnf --enablerepo=remi-php71 install php php-mcrypt php-mysql php-pgsql php-cli php-fpm


3. After installing PHP7 and other PHP7 modules, we will now able to test if our operating system knows PHP version. You can write on your shell php -v to know the version of the php that you installed.

php -v

No comments:

Post a Comment