从一台服务器上拷贝php-fpm程序到另一台后启动提示错误:/etc/init.d/php-fpm-5.4 start
Starting php-fpm [27-Jul-2017 11:31:39] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525/gearman.so' - libgearman.so.8: cannot open shared object file: No such file or directory in Unknown on line 0
done
看错误提示是找不到libgearman.so.8
开始是怀疑直接拷贝的gearman.so扩展不能用,从网上下载gearman重新编译:下载最新版本:
$ wg
$ tar zxvf gearman-1.1.1.tgz
$ cd gearman-1.1.1/
$ phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ make install
make过程中有错误: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 gearman support... yes, shared
not found
提示需要安装libgearman,到这里才知道问题出在哪里,直接yum安装libgearmanyum install libgearman
...
....
.....
Dependencies Resolved
========================================================================================================================
Package Arch Version Repository Size
========================================================================================================================
Installing:
libgearman x86_64 1.1.8-2.el6 epel 70 k
Installing for dependencies:
boost-system x86_64 1.41.0-28.el6 base 26 k
Transaction Summary
========================================================================================================================
Install 2 Package(s)
... 2/2
....
.....
Installed:
libgearman.x86_64 0:1.1.8-2.el6
Dependency Installed:
boost-system.x86_64 0:1.41.0-28.el6
Complete!
可以安装,直接安装后重启php-fpm服务,没有提示错误。解决。/etc/init.d/php-fpm-5.4 restart
Gracefully shutting down php-fpm . done
Starting php-fpm done