GD Library extension not available
2024-09-06 00:00:41
在后台文章上传封面时,遇到了这样一个错误
GD Library extension not available with this PHP installation Ubuntu Nginx
自己在本地开发环境上用到了Intervention/image,但是部署代码到服务器后为考虑到开启GD扩展,导致在使用时遇到了这个错误,通过搜索引擎,找到了解决方案。简单概括就是要安装对应版本的GD库。以下内容是stackoverflow上一个回答的搬运分享。
GD图形扩展库是一个可动态处理图片的PHP扩展。在Ubuntu系统上应该手动的去安装它:
PHP5: sudo apt-get install php5-gd
PHP7.0: sudo apt-get install php7.0-gd
PHP7.1: sudo apt-get install php7.1-gd
PHP7.2: sudo apt-get install php7.2-gd
PHP7.3: sudo apt-get install php7.3-gd
以上就是对应Ubuntu各版本的命令操作。你可以通过以下命令验证GD扩展是否已启用:
php -i | grep -i gd
正常的输出结果应该是这样的:
GD Support => enabled
GD headers Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0
最新文章
- Sql Server系列:SQL语句查询数据库中表、视图、存储过程等组成
- HTML5系列:HTML5与HTML4的区别
- docker-centos 7.2
- Unity3D中制作Loading场景进度条
- HDU 1072(记忆化BFS)
- 实现Android Studio JNI开发C/C++使用__android_log_print输出Log
- 部门树形结构,使用Treeview控件显示部门
- socket的半包,粘包与分包的问题
- 转载:C++ STL set学习
- map 和 reduce
- oracle整体知识的大致介绍(1)-概念
- niceScroll接口大全
- OpenGL与vs编程——error C2440: “glMaterialfv”: 无法从“GLfloat”转换为“const GLfloat *”
- 深度学习 Fine-tune 技巧总结
- Unity3d导出Recast geomset.txt
- Optimizing Java笔记:高级垃圾回收
- 好代码是管出来的——C#的代码规范
- 倍增\ tarjan求lca
- python 单例模式的四种实现方法及注意事项
- Oracle通过ROWID删除表中重复记录