7

添加swoole扩展的一个报错处理

 3 years ago
source link: https://wiki.eryajf.net/pages/688d60/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安装swoole扩展步骤如下:

# 1,下载包。

$ wget https://pecl.php.net/get/swoole-4.3.6.tgz

# 2,编译。

tar xf swoole-4.3.6.tgz
cd swoole-4.3.6
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config && make && make install

# 3,添加扩展。

cat >> /usr/local/php/etc/php.ini << EOF
extension=swoole.so
EOF

# 4,重启验证。

$ systemctl restart php-fpm

$php -m |grep swoole
swoole

可能报错:

(/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole: cannot open shared object file: No such file or directory), /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole.so (libhiredis.so.0.13: cannot open shared object file: No such file or directory)) in Unknown on line 0

需要添加hiredis模块儿:

$ wget https://rpms.remirepo.net/enterprise/7/remi/x86_64/hiredis-last-0.13.3-1.el7.remi.x86_64.rpm
$ yum localinstall -y hiredis-last-0.13.3-1.el7.remi.x86_64.rpm
$ cd /usr/lib64/
$ ln -snf libhiredis.so.0.13 libhiredis.so

然后重启PHP,再验证就不会报那个错误了。


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK