GD 库扩展不适用于此 PHP 安装 Ubuntu Nginx [英] GD Library extension not available with this PHP installation Ubuntu Nginx

查看:28
本文介绍了GD 库扩展不适用于此 PHP 安装 Ubuntu Nginx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 ubuntu 14.04 服务器和 Nginx 网络服务器上使用 Laravel 网络框架,当我尝试上传一个使用 Laravel 将文件发送到服务器.我的上传目录位于具有 777 权限的 public/uploads 文件夹中.

I am using Laravel web framework on my ubuntu 14.04 server and Nginx web server, I have this error when I try to upload a file using Laravel to the server. my upload directory is on the public/uploads folder that has 777 permission.

推荐答案

GD 图形库用于动态处理图像.对于 Ubuntu,您应该手动安装它:

The GD Graphics Library is for dynamically manipulating images. For Ubuntu you should install it manually:

  • 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
  • PHP7.4:sudo apt-get install php7.4-gd
  • PHP8.0:sudo apt-get install php8.0-gd

就是这样,您可以验证是否加载了 GD 支持:

That's all, you can verify that GD support loaded:

php -i | grep -i gd

输出应该是这样的:

GD Support => enabled
GD headers Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0

最后重启你的apache:

and finally restart your apache:

sudo service apache2 restart

这篇关于GD 库扩展不适用于此 PHP 安装 Ubuntu Nginx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆