安装hiredis后添加swoole扩展报错问题

编译swoole时,在configure指令中加入--enable-async-redis 编译成功后,在php.ini中加入extension=swoole.so 然后执行php -m 时报错,如下:

NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'swoole.so' (tried: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole.so (libhiredis.so.0.14: cannot open shared object file: No such file or directory), /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole.so.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

解决办法:
1、编辑 /etc/ld.so.conf 文件,添加 /usr/local/lib
2、保存之后,执行 ldconfig 命令

你可能感兴趣的:(安装hiredis后添加swoole扩展报错问题)