Package ‘oniguruma‘, required by ‘virtual:world‘, not found

Posted 7*24 工作者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Package ‘oniguruma‘, required by ‘virtual:world‘, not found相关的知识,希望对你有一定的参考价值。

一、操作系统环境

OS版本信息:Rocky Linux 9.1
php版本:8.0.26
安装的依赖:

dnf -y install libXpm-devel libXext-devel  gmp gmp-devel libicu* icu*  net-snmp-devel libpng-devel libjpeg-devel  freetype-devel  libxslt-devel sqlite-devel  autoconf libwebp-devel gd-devel

二、PHP的编译

1、编译参数

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --disable-debug --disable-phpdbg \\
--with-bz2 --enable-exif --with-freetype --enable-fpm  --enable-opcache --enable-pcntl --with-gmp --enable-mbstring \\
--enable-soap --enable-calendar --enable-bcmath  --enable-ftp --enable-intl --with-jpeg --enable-shmop --with-openssl \\
--with-curl --enable-gd --with-gettext=/usr --with-xpm --with-mhash  --enable-sockets --with-zlib \\
--enable-mysqlnd --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql

备注: rockylinux9.1 默认安装的openssl版本是 3.0.1 ,用这个版本php编译加上--with-openssl参数后,make的时候会报错,所以建议手动安装一个低版本的openssl,用这个地址 https://www.openssl.org/source/openssl-1.1.1t.tar.gz 下载编译openssl就可以。

2、报错信息

这个是由于编译的时候 --enable-mbstring 这个参数导致的,解决办法,需要安装 oniguruma-devel 开发包

[root@localhost php-8.0.26]# dnf -y install oniguruma-devel    #安装开发包
Last metadata expiration check: 0:24:41 ago on Fri Feb 17 09:27:40 2023.
No match for argument: oniguruma-devel
Error: Unable to find a match: oniguruma-devel

[root@localhost php-8.0.26]# dnf search oniguruma-devel   #搜索开发包,但是没有找到
Last metadata expiration check: 0:24:47 ago on Fri Feb 17 09:27:40 2023.
No matches found.
[root@localhost php-8.0.26]# 

三、处理报错信息

1、 访问 https://pkgs.org/ ,搜索 oniguruma-devel 关键词,然后找对应操作系统版本的开发包。

备注: 在搜索关键词的时候可能需要认证,按照上面的提示认证即可。

2、找到对应的开发包(根据自己的操作系统找对应的开发包)以后,点击,进入开发包的下载页面。
例如:找到的开发包是 oniguruma-devel-6.9.6-1.el9.5.x86_64.rpm ,点击 oniguruma-devel-6.9.6-1.el9.5.x86_64.rpm ,就可以进入这个开发包的下载页面,进入这个页面后也能需要认证。

3、找对开发包的二进制包的下载地址,在服务器上下载完成后,用 dnf -y isntall 包名 命令安装。

4、服务器上下载开发包

[root@localhost ~]# wget https://dl.rockylinux.org/pub/rocky/9/devel/x86_64/os/Packages/o/oniguruma-devel-6.9.6-1.el9.5.x86_64.rpm


5、本地安装开发包

[root@localhost ~]# dnf -y install oniguruma-devel-6.9.6-1.el9.5.x86_64.rpm


6、重新编译php,错误信息就没有了

以上是关于Package ‘oniguruma‘, required by ‘virtual:world‘, not found的主要内容,如果未能解决你的问题,请参考以下文章

[PHP] 解决no package ‘oniguruma’ found

Package ‘oniguruma‘, required by ‘virtual:world‘, not found

与其他跨平台正则表达式库相比,Oniguruma 有多好?

视觉SLAM十四讲 报错 Could not find a configuration file for package “OpenCV“ that is compatible with reques

干货 | Logstash自定义正则表达式ETL实战

package.json字段分析