解决方法:(2个文件我自己的百度云盘里面也有,在linux相关文件夹)
一、先查看一下php-fpm的启动情况:(到底是不是这个问题造成的)
[[email protected] ~]# find / -name php-fpm #查看php-fpm
/www/wdlinux/init.d/php-fpm
/www/wdlinux/nginx_php-5.2.17/sbin/php-fpm
[[email protected] ~]# /www/wdlinux/init.d/php-fpm start #启动一下php-fpm 下面报错了(缺少包mhash)
Starting php_fpm /www/wdlinux/nginx_php-5.2.17/bin/php-cgi:
error while loading shared libraries:
libmhash.so.2: cannot open shared object file: No such file or directory failed
二、下载mhash包:
百度分享地址:http://pan.baidu.com/s/1bpkk3td 当然也可以去网上搜索下载!
下载完成后上传到服务器或虚拟机上,xftp服务器连接软件下载!
上传完成,回到终端上:
[[email protected] ~]# ls #查看一下上传的包
mhash-0.9.9.9.tar.gz
[[email protected] ~]# tar xf mhash-0.9.9.9.tar.gz #解压mhash-0.9.9.9.tar.gz包
[[email protected] ~]# cd mhash-0.9.9.9 #进入到解压后生成的mhash-0.9.9.9目录中去
[[email protected] mhash-0.9.9.9]# ./configure #配置,检测安装环境
[[email protected] mhash-0.9.9.9]# make && make install #编译 && 安装
[[email protected] mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
[[email protected] mhash-0.9.9.9]# vim /etc/ld.so.conf.d/mhash.conf #新建的一个配置文件,往里写入:/usr/lib/
#以上这里特别说明:输入以上命令后需要手动输入 /usr/lib/,写好后需要输入命令 :wq 才能出来,具体可以百度 vim命令
[[email protected] mhash-0.9.9.9]# cat /etc/ld.so.conf.d/mhash.conf #里面就只有:/usr/lib/
/usr/lib/
[[email protected] mhash-0.9.9.9]# ldconfig
[[email protected] mhash-0.9.9.9]# /www/wdlinux/init.d/php-fpm start #再启动一下php-fpm,还是报缺少包
Starting php_fpm /www/wdlinux/nginx_php-5.2.17/bin/php-cgi:
error while loading shared libraries:
libmcrypt.so.4: cannot open shared object file: No such file or directory
三、下载mcrypt包:
百度分享地址:http://pan.baidu.com/s/1dEEYrkt 当然也可以去网上搜索下载!
下载完成后上传到服务器或虚拟机上,xftp服务器连接软件下载!
上传完成,回到终端上:
[[email protected] ~]# ls #查看一下上传的包
libmcrypt-2.5.8.tar.gz
[[email protected] ~]# tar xf libmcrypt-2.5.8.tar.gz #解压libmcrypt-2.5.8.tar.gz包
[[email protected] ~]# cd libmcrypt-2.5.8 #进入到解压后生成的libmcrypt-2.5.8目录中去
[[email protected] libmcrypt-2.5.8]# ./configure #配置,检测安装环境
[[email protected] libmcrypt-2.5.8]# make && make install #编译 && 安装
[[email protected] libmcrypt-2.5.8]# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
[[email protected] libmcrypt-2.5.8]# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4
[[email protected] libmcrypt-2.5.8]# /www/wdlinux/init.d/php-fpm start #再次启动php-fpm,成功
Starting php_fpm don
[[email protected] libmcrypt-2.5.8]# reboot #重新开机
此文转自:http://www.youhutong.com/index.php/article/index/97.html