美文网首页
PHP安装gd.so扩展

PHP安装gd.so扩展

作者: 鱼落于天 | 来源:发表于2021-01-06 09:19 被阅读0次

安装错误时 命令行使用 php -v 会有一个警告, 警告 php 的gd库 不能连接或者失败

PHP Startup: Invalid library (maybe not a PHP library) ‘gd.so’ in Unknown on line 0

此时需要重新编译

安装依赖

yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel

切换到 php源码 /ext/gd 目录下

make clean && phpize 
./configure --with-png-dir --with-freetype-dir --with-jpeg-dir --with-gd --with-xpm-dir --with-xbm-dir
 make  && make install

注意:第二行命令
./configure 有可能有错误,提示什么错误就去掉对应的with 或者去安装对应的依赖

相关文章

网友评论

      本文标题:PHP安装gd.so扩展

      本文链接:https://www.haomeiwen.com/subject/gzxnoktx.html