错误信息 “/lib64/libm.so.6: version `GLIBC_2.27′ not found” 表示程序运行需要 GLIBC 2.27 版本的 libc 库,而系统中安装的 libc 库的版本较低,因此无法找到所需的库。

要解决这个问题,一种可行的方法是更新 libc 库的版本。可以按照以下步骤进行操作:

  1. 检查系统中 libc 库的版本。可以使用以下命令查看:
ldd --version

该命令会返回系统中的 libc 库版本以及其他相关信息。

  1. 下载 GLIBC 2.27 版本的源码包。可以从 GLIBC 的官方网站下载(http://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz)。
  2. 解压源码包并进入源码目录。
  3. 编译并安装 GLIBC 2.27。可以使用以下命令:
./configure --prefix=/usr/local/glibc-2.27
make
sudo make install

请注意,安装的目录可以根据实际情况进行修改。

  1. 将新的 libc 库路径添加到 LD_LIBRARY_PATH 环境变量中。可以使用以下命令:
export LD_LIBRARY_PATH=/usr/local/glibc-2.27/lib:$LD_LIBRARY_PATH
  1. 重新运行程序,查看是否仍然出现错误。

请注意,更新系统的 libc 库版本可能会影响到其他程序的运行,因此在执行此操作之前,请仔细考虑潜在的影响,并在操作之前备份重要数据。

该错误表示系统中没有找到可执行sudo命令。sudo是Linux和Unix系统中的特权命令,允许普通用户以超级用户(也称为root用户)的身份执行操作。

如果正在使用MacOS系统,则可以尝试通过在终端中输入以下命令来安装sudo:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

如果正在使用Ubuntu或Debian系统,则可以使用以下命令安装sudo:

apt-get update
apt-get install sudo

如果您正在使用其他Linux或Unix系统,请参考相关文档以了解如何安装sudo或联系系统管理员。

解决执行 pecl upgrade-all 提示 Error getting channel info from pear.php.net: Connection to `ssl://pear.php.net:443' failed:Connection to 'ssl://pecl.php.net:443' failed: Unable to find the socket 错误。

出现这个错误主要是因为缺失默认证书导致的,具体原因不明。

下面说一下解决方案:

1、查看 default_cert_file 的路径

php -r "print_r(openssl_get_cert_locations());"

2、下载证书

wget -P /etc/ssl/ http://curl.haxx.se/ca/cacert.pem
chmod 744 /etc/ssl/cacert.pem

注意:其中 /etc/ssl/cacert.pem 替换为自己的真实路径

CentOS 7 源码安装 CMake 3.17.0 最新稳定版。解决 cmake: command not found 问题。

1、准备编译环境

yum -y install gcc gcc-c++ openssl openssl-devel tar make

2、获取源码,并解压

wget https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz
tar -zxf cmake-3.17.0.tar.gz
cd cmake-3.17.0

备用下载地址:https://down.24kplus.com/linux/cmake/cmake-3.17.0.tar.gz

3、编译安装

./bootstrap --prefix=/usr --datadir=share/cmake --docdir=doc/cmake && make
sudo make install

4、检查是否正确安装

cmake --version

cmake version 3.17.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

CentOS 7/8 安装 onigurumaoniguruma-devel 。解决 configure: error: Package requirements (oniguruma) were not met: Package 'oniguruma', required by 'virtual:world', not found 问题。

CentOS 7 安装

yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-6.7.0-1.el7.x86_64.rpm
yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-devel-6.7.0-1.el7.x86_64.rpm

备用下载:

oniguruma:http://down.24kplus.com/linux/oniguruma/oniguruma-6.7.0-1.el7.x86_64.rpm
oniguruma-devel:http://down.24kplus.com/linux/oniguruma/oniguruma-devel-6.7.0-1.el7.x86_64.rpm

CentOS 8 安装

yum config-manager --set-enabled PowerTools
yum -y install oniguruma oniguruma-devel

CentOS 7 源码安装 CMake 3.16.2 最新稳定版。解决 cmake: command not found 问题。

1、准备编译环境

yum -y install gcc gcc-c++ openssl openssl-devel tar

2、获取源码,并解压

wget https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2.tar.gz
tar -zxf cmake-3.16.2.tar.gz
cd cmake-3.16.2

备用下载地址:https://down.24kplus.com/linux/cmake/cmake-3.16.2.tar.gz

3、编译安装

./bootstrap --prefix=/usr --datadir=share/cmake --docdir=doc/cmake && make
sudo make install

4、检查是否正确安装

cmake --version

cmake version 3.16.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

CentOS 7 源码安装 libmaxminddb 1.3.2 最新版。 libmaxminddb 是 ngx_http_geoip2_module 依赖项之一。

1、下载源码,并解压

wget https://github.com/maxmind/libmaxminddb/releases/download/1.3.2/libmaxminddb-1.3.2.tar.gz
tar -xvf libmaxminddb-1.3.2.tar.gz
cd libmaxminddb-1.3.2

备用下载地址:https://down.24kplus.com/linux/libmaxminddb-1.3.2.tar.gz

2、编译安装

./configure --prefix=/usr
make
sudo make install
sudo ldconfig

yum 源里最新的 gcc 版本是 4.8.5,但很多时候安装软件依赖于更高版本的 gcc,这时候只能通过手动源码安装最新版。

使用源码编译安装gcc耗时非常大,请要有耐心等待,耐心等待,耐心等待,重要的事情说三遍。

如果你觉得步麻烦可以使用 gcc一键安装 帮你完成!

1、下载并解压源码

wget https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz
tar -zxf gcc-9.2.0.tar.gz
cd gcc-9.2.0

备用下载地址:https://down.24kplus.com/linux/gcc-9.2.0.tar.gz

2、编译安装

下载必要软件包

./contrib/download_prerequisites

如果提示 tar (child): lbzip2: Cannot exec: No such file or directory 错误:

yum -y install bzip2

编译安装gcc

./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-bootstrap \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--disable-libunwind-exceptions \
--enable-gnu-unique-object \
--enable-linker-build-id \
--with-linker-hash-style=gnu \
--enable-languages=c,c++ \
--enable-plugin \
--enable-initfini-array \
--disable-libgcj \
--enable-gnu-indirect-function \
--with-tune=generic \
--with-arch_32=x86-64 \
--build=x86_64-redhat-linux \
--disable-multilib
make
make install

如果出现 configure: error: GNAT is required to build ada 错误

yum -y install gcc-gnat -y

如果出现 fatal error: zlib.h: No such file or directory 错误

yum install zlib-devel -y

如果出现 configure: error: C++ preprocessor "/lib/cpp" fails sanity check 错误

yum install gcc-c++ -y

如果出现 makeinfo: command not found 错误

yum install texinfo -y

为了避免日后编译软件发生 checking for C compiler … not found 错误,执行:

ln -s /usr/bin/gcc /usr/bin/cc

4、检查是否正确安装

gcc -v