0

I have an environment with the following setup:

  • Centos/RHEL 8
  • PHP 7.4 installed from Remi's repository

I have set installed php like so:

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf -y install http://rpms.remirepo.net/enterprise/remi-release-8.rpm 

sudo dnf -y install php74 php74-php-common php74-php-devel php74-php-cli php74-php-fpm

Now I want to install php-opcache. However dnf is reporting that there doesn't appear to be a module php74-php-opcache.

$ sudo dnf install php74-php-opcache

Updating Subscription Management repositories.
Last metadata expiration check: 0:56:51 ago on Fri 04 Jun 2021 13:52:35 NZST.
No match for argument: php74-php-opcache
Error: Unable to find a match: php74-php-opcache

I'm fairly convinced this has something to do with how repos are set up, as on my dev environment, it works.

$ sudo dnf -y install php74-php-opcache
Last metadata expiration check: 0:11:18 ago on Fri 04 Jun 2021 02:36:41 PM NZST.
Dependencies resolved.
==================================================================================================================================================================================================================================
 Package                                                    Architecture                                    Version                                                      Repository                                          Size
==================================================================================================================================================================================================================================
Installing:
 php74-php-opcache                                          x86_64                                          7.4.20-1.el8.remi                                            remi-safe                                          274 k

Here is the output of dnf repolist on the problem environment:

$ sudo dnf repolist
Updating Subscription Management repositories.
repo id                                                                                                repo name
epel                                                                                                   Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                                                                                           Extra Packages for Enterprise Linux Modular 8 - x86_64
mod-pagespeed                                                                                          mod-pagespeed
pgdg-common                                                                                            PostgreSQL common RPMs for RHEL/CentOS 8 - x86_64
pgdg12                                                                                                 PostgreSQL 12 for RHEL/CentOS 8 - x86_64
remi-modular                                                                                           Remi's Modular repository for Enterprise Linux 8 - x86_64
rhel-8-for-x86_64-appstream-rpms                                                                       Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms                                                                          Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

As a sidenote, I have tried dnf install php-opcache. This is found fine. But it downloads version 7.2 and puts the opcache.so in a different location to where PHP is looking for modules and no 10-opcache.ini file. I did try manually copy these file to where this installation of PHP is looking for those files, but I got a warning

/opt/remi/php74/root/usr/lib64/php/modules/opcache.so: undefined symbol: _zval_ptr_dtor
Aaryn
  • 1,601
  • 2
  • 18
  • 31

1 Answers1

1

Obviously, from the pasted repolist, "remi" repository is not enabled.

For a proper configuration, follow the wizard instructions

Remi Collet
  • 6,198
  • 1
  • 20
  • 25
  • And I'm unsure why. Even following the Wizard you linked, installing the repos it instructs says "already installed" and `dnf install php74-php-opcache` says the same thing "No match for argument: php74-php-opcache" – Aaryn Jun 04 '21 at 04:45
  • "already installed" means the configuration package is installed, not that the repository is enabled. php74-php-opcache is in "remi-safe" which is enabled by default but looks like it has been disabled on your system. – Remi Collet Jun 04 '21 at 04:49
  • Ah. Your answers led me to this: https://www.tecmint.com/enable-remi-repository-in-centos-redhat-fedora/ and found that remi was not enabled by default. `dnf --enablerepo=remi install php74-php-opcache` is what I needed. Thank you. – Aaryn Jun 04 '21 at 04:52
  • "remi-safe" should be enough for php74* packages, and can be enabled permanently to avoid such issue in the future – Remi Collet Jun 04 '21 at 05:19
  • Thanks for the tip Remi, and the awesome package repo. – Aaryn Jun 06 '21 at 08:14