1. 程式人生 > >php-fpm啟動報錯:libgearman.so.8: No such file or directory in Unknown on line 0

php-fpm啟動報錯:libgearman.so.8: No such file or directory in Unknown on line 0

php 報錯 php-fpm

從一臺服務器上拷貝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安裝libgearman

yum 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



php-fpm啟動報錯:libgearman.so.8: No such file or directory in Unknown on line 0