Laravel Intervention Image GD库扩展 [英] Laravel Intervention Image GD library extension

查看:54
本文介绍了Laravel Intervention Image GD库扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对不起,我的问题可能太含糊.因此,我将尽力澄清我的问题.

First of all, I am sorry if my question may be too vague. So, I will try to clarify my question as much as possible.

我目前正在开发Laravel应用程序,并且正在尝试使用Intervention Image Facade.当我尝试使用它测试上传时,出现以下错误:-

I am currently developing a Laravel application, and I am trying to use Intervention Image Facade. When I tried to use it to test an upload, I got the following error:-

NotSupportedException in Driver.php line 16: GD Library extension not available with this PHP installation.

因此,我将尝试使用sudo apt-get install libgd3安装GD库,并使用sudo apt-get php5.6-gd安装php gd驱动程序.但是,这不起作用,并且相同的错误不断在laravel中弹出.我明显错过了什么,接下来我该怎么做?

So, as I would try to do, I installed the GD library using sudo apt-get install libgd3 and the php gd driver using sudo apt-get php5.6-gd. However, this did not work, and the same error keeps popping up in laravel. What have I clearly missed, and what should I follow next?

编辑1.我使用以下命令查看php是否确实支持gd驱动程序:-php -i | grep -i --color gd

Edit 1. I used the following command to see if php actually supports gd driver : - php -i | grep -i --color gd

得出以下结果:-

/etc/php/5.6/cli/conf.d/20-gd.ini,
gd
GD Support => enabled
GD headers Version => 2.2.3
GD library Version => 2.2.3
gd.jpeg_ignore_warning => 0 => 0
GDM_LANG => en_US
GDMSESSION => ubuntu
_SERVER["GDM_LANG"] => en_US
_SERVER["GDMSESSION"] => ubuntu

希望这会提供更多帮助.

Hope this helps even more.

编辑2 感谢所有回答.我在Mayank Pandey的答案中找到了解决方案.

EDIT 2 Thanks to all who answered. I found my solution in Mayank Pandey's answer.

推荐答案

这是因为服务器上缺少GD库.

This is because the GD Library is missing on your server.

您必须启用库GD2.

找到(正确的)php.ini文件,然后找到以下行:

Find your (proper) php.ini file, and then find the line:

;extension=php_gd2.dll,除去前面的分号. ;表示该行已注释,因此请删除注释)

;extension=php_gd2.dll, remove the semicolon in the front. ; means the line is commented, so remove the comment)

该行应如下所示:

extension=php_gd2.dll

然后重新启动apache,您就可以开始了.

Then restart apache and you are ready to go.

这篇关于Laravel Intervention Image GD库扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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