启动报错现象:wrong ELF class: ELFCLASS32
test@ubuntu:/usr/local/zend$ sudo lnmp php-fpm start
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| http://lnmp.org |
+-------------------------------------------+
Starting php-fpm Failed loading /usr/local/zend/ZendGuardLoader.so: /usr/local/zend/ZendGuardLoader.so: wrong ELF class: ELFCLASS32
[03-May-2017 00:03:15] ERROR: FPM initialization failed
failed
此错误是因为php-fpm模块所调用的ZendGuardLoader.so模块为32位的模块,然而当前系统为64为系统,因此在启动时报错了,重新下载一个64位的ZendGuardLoader.so放到/usr/local/zend/下,然后重新执行lamp php-fpm start即可。以下为修复步骤:
用file命令查看当前的ZendGuardLoader.so的文件信息,可以看到当前so文件为32位的文件。
test@ubuntu:/usr/local/zend$ file ZendGuardLoader.so |
ZendGuardLoader.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped |
下载解压64位的ZendGuardLoader,然后替换原来的.so文件之后重新启动php-fpm
wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz |
tar -xvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz |
cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so /usr/local/zend/ |
重新用file看下替换之后的ZendGuardLoader.so,可以看到当前为64位的文件了。
test@ubuntu:/usr/local/zend$ file ZendGuardLoader.so |
ZendGuardLoader.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped |