-2

I do find a lot similar problems on CentOS in this forum, and I tried to follow any suggestions mentioned in their answer, however, none solves my problem. Therefore I’m opening this question for platform specific solution.

I have downloaded httpd, php, php-common, php-cli. From some answer it seems having php installed would be already sufficient, but the PHP file is not handled by php. I tried to search for libphp, *php* with yum and dnf command, but returned result does not have any match to httpd/apache module for php. On ubuntu server I do find similar module mentioned in other answer and php is working properly to phrase the page. I also set fileMatch to set handler, but I think due to the missing libphp8.so module it is not working.

From the search suggested in the comment below, I found php-embedded is the only package that provide libphp.so or libphp-8.0.so. However, neither has symbol php_module, but both are callable by php_embed_module. So I added this in the config file, but apachectl configtest shows it is not an apache module. The answer below has suggested php-fpm, but from the install utility it seems to be Nginx-based.

I was wondering since Red hat and Oracle are both CentOS like, can I just add RHEL 9's repo to dnf and check if they have a compatible module. But would that has compatibility concerns?

The HTTPD version is (httpd -v):

Server version: Apache/2.4.53 (Oracle Linux Server)

The PHP version is:

PHP 8.0.20

and The system version is (cat /etc/os-release | grep PRETTY_NAME):

PRETTY_NAME="Oracle Linux Server 9.1"

1 Answers1

0

You did not set your repo properly. Or do not search for the proper package. Here is the repo for Oracle Linux 9 and as you can see there are php packages.

Check here for Oracle procedure how to install it.

You can also check here how to install php on OracleLinux.

And BTW check for php-fpm

Romeo Ninov
  • 5,263
  • 4
  • 20
  • 26
  • No, I’ve installed `php` but there is no `libphp.so` library for apache – jimmymcheung Jan 28 '23 at 21:45
  • I also checked if there is `mod_php.so` but that’s also not the case – jimmymcheung Jan 28 '23 at 21:47
  • See my edited answer – Romeo Ninov Jan 29 '23 at 09:07
  • Your latter way needs to disable SELinux Policy. and the first guide is also only installing php (which I did), but I do found, with `dnf whatprovides` the `php-embedded` to be the right one to install. – jimmymcheung Jan 30 '23 at 11:03
  • Just want to add, the library comes with `php-embedded` is not a apache module (`configtest` has warned me), and does not have `php_module` or `mod_php` in it's symbol (from `nm -gD libphp-8.0.so` it seems only `php_embed_module` is suitable). Moreover, the `php-fpm` you mentioned appears to work with Nginx (since the install requires additional `nginx-filesystem` package) – jimmymcheung Jan 30 '23 at 11:34