系统:centos6.x
环境:宝塔linux面板5.x php:5.6
查看php扩展已经安装bz2,但重启php服务后报错,如下
发生错误: [27-Feb-2018 20:16:15] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/www/server/php/56/lib/php/extensions/no-debug-non-zts-20131226/bz2.so' - /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /www/server/php/56/lib/php/extensions/no-debug-non-zts-20131226/bz2.so) in Unknown on line 0
从错误中可以看出glibc版本太低,导致报错 解决方法如下:
下载glibc-2.14:
http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
解压:
tar glibc-2.14.tar.gz
切换目录到glibc-2.14:
cd glibc-2.14
创建目录:
mkdir build cd build
配置目录:
../configure --prefix=/usr/local/glibc-2.14
编译安装:
make -j4 make install
临时修改环境变量:
export LD_LIBRARY_PATH=/usr/local/glibc-2.14/lib:$LD_LIBRARY_PATH
删除软连接:
rm /lib64/libc.so.6
创建软连接:
ln -s /usr/local/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6