php - 为通过 Remi 的存储库安装的 PHP 安装 php-opcache
问题描述
我有一个具有以下设置的环境:
- Centos/RHEL 8
- 从 Remi 的存储库安装的 PHP 7.4
我已经像这样设置了安装的php:
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
现在我想安装 php-opcache。但是 dnf 报告说似乎没有 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
我相当确信这与 repos 的设置方式有关,就像在我的开发环境中一样,它可以工作。
$ 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
这是dnf repolist
问题环境的输出:
$ 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)
作为旁注,我尝试过dnf install php-opcache
. 发现这很好。但它会下载 7.2 版并将 opcache.so 放在与 PHP 寻找模块的位置不同的位置,并且没有 10-opcache.ini 文件。我确实尝试手动将这些文件复制到此 PHP 安装正在查找这些文件的位置,但我收到了警告
/opt/remi/php74/root/usr/lib64/php/modules/opcache.so: undefined symbol: _zval_ptr_dtor
解决方案
显然,从粘贴的 repolist 中,“remi”存储库未启用。
要进行正确配置,请按照向导说明进行操作
推荐阅读
- php - 为什么我的 OnSelect 事件没有相应地触发
- ssrs-2012 - 如何保持组的顺序
- arrays - 谷歌表格公式提取日期
- python-3.x - 如何将 API 密钥凭证与 Google 文本转语音客户端库方法一起使用?
- ios - iOS / Swift:在 UITextFields 的键盘上显示电子邮件地址建议
- google-cloud-firestore - 使用模拟器时无法在浏览器中查看 GCP Datastore (Firestore) 中的数据
- mysql - VerneMQ MySQL 身份验证
- javascript - 浅色模式在网站上加载深色模式之前出现片刻
- node.js - 使用 mongoDB 如何防止某人使用与其他人相同的用户名?
- c++ - 带有 const 参数的模板 operator= 问题