CentOS 8 官方仓库的 PHP 安装 Redis 扩展

经验 暂无评论

在 CentOS 新版本上部署 LNMP 架构时,因开发环境一直是 PHP 7.2 ,结果发现 C8 系统官方仓库内自带的 PHP 版本就是 7.2 ,后续使用过程中发现缺少部分扩展。

官方构建版本中没有 Redis 扩展,因此需要自行编译安装。

切换到工作目录

# cd /usr/local/src

官方扩展源中下载源码包

小贴士:需要注意的是,扩展的版本和所需依赖的版本和 PHP 版本有关,请自行确定需要的版本。

# wget http://pecl.php.net/get/redis-5.2.1.tgz

对源码包进行解包

# tar xf redis-5.2.1.tgz

对本地环境进行检测生成安装配置

# phpize

小贴士:如果没有找到此命令说明在部署时,只安装了 php-fpm 组件,此命令需要额外安装 php-cli 组件。

如果执行时遇到以下报错

# phpize 
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.

需要补全开发组件

# dnf install php-devel

正常结果如下

# phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718

然后即可开始编译扩展的库文件

# cd redis-5.2.1/
# ./configure --with-php-config=/usr/bin/php-config

安装库文件

# make install
Installing shared extensions:     /usr/lib64/php/modules/

接下来的步骤需要注意,需要将扩展的库文件进行注册,以便 PHP 程序对其进行识别和加载

先检查是否存在编译后的库文件 (.so)

# ls -l /usr/lib64/php/modules/
total 13348
-rwxr-xr-x 1 root root 3363488 Mar 30 15:22 redis.so

然后找到系统扩展配置文件

# ls -l /etc/php.ini

扩展:在其中可以看到配置中将 /etc/php.d/ 中的配置全部加载进了主配置中,因此只需操作子目录加载配置文件即可。

# cd /etc/php.d/
# ll
total 128
-rw-r--r-- 1 root root 4848 Nov 14 12:04 10-opcache.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-bz2.ini
-rw-r--r-- 1 root root   54 Nov 14 12:09 20-calendar.ini
-rw-r--r-- 1 root root   48 Nov 14 12:09 20-ctype.ini
-rw-r--r-- 1 root root   46 Nov 14 12:09 20-curl.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-dom.ini
-rw-r--r-- 1 root root   46 Nov 14 12:09 20-exif.ini
-rw-r--r-- 1 root root   54 Nov 14 12:09 20-fileinfo.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-ftp.ini
-rw-r--r-- 1 root root   42 Nov 14 12:09 20-gd.ini
-rw-r--r-- 1 root root   52 Nov 14 12:09 20-gettext.ini
-rw-r--r-- 1 root root   48 Nov 14 12:09 20-iconv.ini
-rw-r--r-- 1 root root   46 Nov 14 12:09 20-json.ini
-rw-r--r-- 1 root root   54 Nov 14 12:09 20-mbstring.ini
-rw-r--r-- 1 root root   52 Nov 14 12:09 20-mysqlnd.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-pdo.ini
-rw-r--r-- 1 root root   46 Nov 14 12:09 20-phar.ini
-rw-r--r-- 1 root root   56 Nov 14 12:09 20-simplexml.ini
-rw-r--r-- 1 root root   52 Nov 14 12:09 20-sockets.ini
-rw-r--r-- 1 root root   52 Nov 14 12:09 20-sqlite3.ini
-rw-r--r-- 1 root root   56 Nov 14 12:09 20-tokenizer.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-xml.ini
-rw-r--r-- 1 root root   56 Nov 14 12:09 20-xmlwriter.ini
-rw-r--r-- 1 root root   44 Nov 14 12:09 20-xsl.ini
-rw-r--r-- 1 root root   50 Nov 14 12:09 30-mysqli.ini
-rw-r--r-- 1 root root   56 Nov 14 12:09 30-pdo_mysql.ini
-rw-r--r-- 1 root root   58 Nov 14 12:09 30-pdo_sqlite.ini
-rw-r--r-- 1 root root   46 Nov 14 12:09 30-wddx.ini
-rw-r--r-- 1 root root   56 Nov 14 12:09 30-xmlreader.ini
-rw-r--r-- 1 root root   47 Nov 14 12:49 40-zip.ini
-rw-r--r-- 1 root root  645 Nov 14 12:09 opcache-default.blacklist

可以看到官方构建的版本为了防止冲突,为全部的扩展进行了分类,并加上了序号。效仿其规律,防止与系统自带的扩展冲突,自行创建配置文件并命名

# touch 99-redis.ini

写入以下配置

; Enable Redis extension module
extension=redis.so

保存后重启 PHP 即可看到效果

# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
redis
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

完整编译过程如下所示,仅供参考。

checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable redis support... yes, shared
checking whether to disable sessions... yes
checking whether to disable json serializer support... yes
checking whether to enable igbinary serializer support... no
checking whether to enable msgpack serializer support... no
checking whether to enable lzf compression... no
checking use system liblzf... no
checking whether to enable Zstd compression... no
checking use system libsztd... yes
checking for json includes... /usr/include/php
checking for redis json support... enabled
checking for redis igbinary support... disabled
checking for git... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
[root@chinecn redis-5.2.1]# make
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis.c -o redis.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis.c  -fPIC -DPIC -o .libs/redis.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_commands.c -o redis_commands.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_commands.c  -fPIC -DPIC -o .libs/redis_commands.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/library.c -o library.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/library.c  -fPIC -DPIC -o .libs/library.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_session.c -o redis_session.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_session.c  -fPIC -DPIC -o .libs/redis_session.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_array.c -o redis_array.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_array.c  -fPIC -DPIC -o .libs/redis_array.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_array_impl.c -o redis_array_impl.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_array_impl.c  -fPIC -DPIC -o .libs/redis_array_impl.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_cluster.c -o redis_cluster.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_cluster.c  -fPIC -DPIC -o .libs/redis_cluster.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/cluster_library.c -o cluster_library.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/cluster_library.c  -fPIC -DPIC -o .libs/cluster_library.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/redis_sentinel.c -o redis_sentinel.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/redis_sentinel.c  -fPIC -DPIC -o .libs/redis_sentinel.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=compile cc  -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/redis-5.2.1/sentinel_library.c -o sentinel_library.lo 
libtool: compile:  cc -I. -I/usr/local/src/redis-5.2.1 -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/redis-5.2.1/sentinel_library.c  -fPIC -DPIC -o .libs/sentinel_library.o
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/src/redis-5.2.1/include -I/usr/local/src/redis-5.2.1/main -I/usr/local/src/redis-5.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/php/ext  -DHAVE_CONFIG_H  -g -O2   -o redis.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/src/redis-5.2.1/modules  redis.lo redis_commands.lo library.lo redis_session.lo redis_array.lo redis_array_impl.lo redis_cluster.lo cluster_library.lo redis_sentinel.lo sentinel_library.lo 
libtool: link: cc -shared  -fPIC -DPIC  .libs/redis.o .libs/redis_commands.o .libs/library.o .libs/redis_session.o .libs/redis_array.o .libs/redis_array_impl.o .libs/redis_cluster.o .libs/cluster_library.o .libs/redis_sentinel.o .libs/sentinel_library.o    -g -O2   -Wl,-soname -Wl,redis.so -o .libs/redis.so
libtool: link: ( cd ".libs" && rm -f "redis.la" && ln -s "../redis.la" "redis.la" )
/bin/sh /usr/local/src/redis-5.2.1/libtool --mode=install cp ./redis.la /usr/local/src/redis-5.2.1/modules
libtool: install: cp ./.libs/redis.so /usr/local/src/redis-5.2.1/modules/redis.so
libtool: install: cp ./.libs/redis.lai /usr/local/src/redis-5.2.1/modules/redis.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/src/redis-5.2.1/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/src/redis-5.2.1/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

附录

参考链接

如果遇到问题或者对文章内容存疑,请在下方留言,博主看到后将及时回复,谢谢!
回复
回答29+46=