在后台文章上传封面时,遇到了这样一个错误

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

最新文章

  1. Sql Server系列:SQL语句查询数据库中表、视图、存储过程等组成
  2. HTML5系列:HTML5与HTML4的区别
  3. docker-centos 7.2
  4. Unity3D中制作Loading场景进度条
  5. HDU 1072(记忆化BFS)
  6. 实现Android Studio JNI开发C/C++使用__android_log_print输出Log
  7. 部门树形结构,使用Treeview控件显示部门
  8. socket的半包,粘包与分包的问题
  9. 转载:C++ STL set学习
  10. map 和 reduce
  11. oracle整体知识的大致介绍(1)-概念
  12. niceScroll接口大全
  13. OpenGL与vs编程——error C2440: “glMaterialfv”: 无法从“GLfloat”转换为“const GLfloat *”
  14. 深度学习 Fine-tune 技巧总结
  15. Unity3d导出Recast geomset.txt
  16. Optimizing Java笔记:高级垃圾回收
  17. 好代码是管出来的——C#的代码规范
  18. 倍增\ tarjan求lca
  19. python 单例模式的四种实现方法及注意事项
  20. Oracle通过ROWID删除表中重复记录

热门文章

  1. ssh1
  2. Angular.js 使用$http的response得到的phone属性为undefined
  3. webGL 旋转算法
  4. goland使用:导入一个github开源项目tidb
  5. Nginx优化_自定义报错页面
  6. Python PostgreSQL Psycopg2
  7. flask之表单
  8. kafka docker-composer.yml
  9. [CH5E02] A Little Shop of Flowers
  10. 吸$DN