phpfpm/nginx容器,因缺少so文件无法启动的解决方案
发布于 作者:苏南大叔 来源:程序如此灵动~
苏南大叔在调整服务器的时候,意外的发现重启服务器后,php-fpm
和nginx
都无法启动了。报错信息都是缺少一些共享的.so
文件。
由于这些错误提示都比较类似,所以合并写解决方案了。本文测试环境:centos7.7
,nginx@1.17
,php@7.3
。
缺少libpng15.so.15
文件
/www/server/php/73/sbin/php-fpm:error while loading shared libraries:libpng15.so.15.
cannot open shared object file:No such file or directory
这个错误是php-fpm
报的,截图如下:
解决方案:
yum install libpng-devel -y
缺少libfreetype.so.6
文件
/www/server/php/73/sbin/php-fpm:error while loading shared libraries:libfreetype.so.6.
cannot open shared object file:No such file or directory
缺少libfreetype.so.6
文件还是php-fpm
报的,截图如下:
解决方案:
yum install freetype freetype-devel -y
缺少libgd.so.2
文件
nginx
由于缺少libgb.so.2
文件,而拒绝工作,截图如下:
/www/server/nginx/sbin/nginx:error while loading shared libraries:libgd.so.2.
cannot open shared object file:No such file or directory
解决方案:
yum install gd -y
相关链接
总结
有点兵来将挡水来土掩的感觉,解决方案就是用yum install
去安装缺少的文件就好了,可能就是库文件点名需要猜一猜而已。
更多centos
经验文章,请点击苏南大叔的博客:


