0

I am having a hard time to figure out how to install the PHP7 modules for Apache 2.4 (httpd) in RedHat7. I've been looking in google and different sites, however is kind of hard to find documentation since this seems to be a weird issue due to my OS version.

php7 is already installed and running in my computer, and i am able to interpret php code via CLI.

I found this website that explains in details how install the module i need:

https://centos.pkgs.org/7/ius-x86_64/mod_php71u-7.1.28-1.ius.centos7.x86_64.rpm.html

It seems to be very clear that using the method indicated should work:

Install mod_php71u rpm package:

yum install mod_php71u

This is what i get after running yum.

No package mod_php71u available.
Error: Nothing to do

OS:
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"

Any help is highly appreciated.

Israelm
  • 1,607
  • 3
  • 23
  • 28
  • This all depends on how you installed PHP initially, and whether you're actually running CentOS or some other RHEL fork, and whether you followed all three steps listed, not just the last one. – miken32 May 09 '19 at 22:43
  • PHP was initially installed using this installer: rhel-server-rhscl-7-rpms. And this is my OS dist: Red Hat Enterprise Linux Server VERSION=7.6 (Maipo) – Israelm May 09 '19 at 23:01
  • Those are CentOS specific packages you’re trying to use – miken32 May 09 '19 at 23:04
  • That was the closest thing i could find to solve my problem, I was told that CentOS works just like Rhel so that was my last shot. Any ideas on where to find this kind of resources for Rhel. I see a big list of options in this and other websites. Just not for Rhel7. :( – Israelm May 09 '19 at 23:10
  • It doesn’t sound like “rhel-server-rhscl-7-rpms” would install php, just the SCL. Look at the packages you have installed and I’m sure a bunch will start with php71 or something. – miken32 May 09 '19 at 23:15
  • You might be right, maybe not by that package. I can't tell for sure what package was used to install it, i was told that was the one that was used. One thing is for sure I have php7 installed and can run commands in my command line. So i have php7, Apache running and the only missing part in the php_mod for Apache. – Israelm May 10 '19 at 00:36

1 Answers1

0

I was finally able to install and run the php7 Apache modules. I am leaving here my findings, hopefully someone will find this useful.

The Apache version that comes by default with Rhel 7 Enterprise edition is not compatible with the php7 packages that RedHat has on its repo.

Its necessary to uninstall httpd and install the latest version form the Rhel repo.

The php_mod for php7 is not available in the Rhel repo as its not recommended. What you need to install the php-fpm packages.

PHP-FPM stands for PHP - FastCGI Process Manager.

Some links:

https://php-fpm.org/

https://www.php.net/manual/en/install.fpm.php

https://www.cyberciti.biz/faq/how-to-install-php-7-2-on-centos-7-rhel-7/

What is the difference between fastcgi and fpm?

How to restart php7 / php-fpm service:

https://www.cyberciti.biz/faq/unix-linux-restart-php-service-command/

Cheers.

Israelm
  • 1,607
  • 3
  • 23
  • 28