Laravel Intervention Image GD library extension

后端 未结 5 1621
不知归路
不知归路 2021-02-08 03:11

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.

I am currently developing a Laravel application, and

相关标签:
5条回答
  • 2021-02-08 03:22

    Install GD extension:

    sudo apt-get install php7.0-gd
    

    For PHP 7.1 try the following:

    sudo apt-get install php7.1-gd
    

    For PHP 7.2 try the following:

    sudo apt-get install php7.2-gd
    

    Then restart your server.

    Apache:

    sudo service apache2 restart
    

    Nginx:

    sudo service nginx restart
    
    0 讨论(0)
  • 2021-02-08 03:29

    After all the above failed, I upgraded to php 7.3.x from php7.2.x, using

        sudo apt install php
    

    then installed gd

        sudo apt-get install php7.3-gd
    

    to be sure, restart the apache server or xampp(as was for my case) and also restart php artisan serve.

    Using the appropriate php.ini file, ensure that "extension=php_gd2.dll" is enabled by removing the semicolon that appears before it.

    then check what you have on grep through

        php -i | grep -i --color gd
    

    it should look like this.

    /etc/php/7.3/cli/conf.d/20-gd.ini,
    gd
    GD Support => enabled
    GD headers Version => 2.2.5
    GD library Version => 2.2.5
    gd.jpeg_ignore_warning => 1 => 1
    GDM_LANG => C.UTF-8
    GDMSESSION => gnome
    XAUTHORITY => /run/user/1000/gdm/Xauthority
    $_SERVER['GDM_LANG'] => C.UTF-8
    $_SERVER['GDMSESSION'] => gnome
    $_SERVER['XAUTHORITY'] => /run/user/1000/gdm/Xauthority
    

    in the case that after this, you get an error concerning drivers on your laravel app, this answer may help solve it.Laravel 5 PDOException Could Not Find Driver

    I hope this helps you.

    0 讨论(0)
  • 2021-02-08 03:31

    Did you enable the gd extension?

    try this is your termital

    php -i | grep gd
    

    my output is:

    frank@frank-ThinkPad-T430:~$ php -i | grep gd
    /etc/php/7.0/cli/conf.d/20-gd.ini,
    gd
    gd.jpeg_ignore_warning => 0 => 0
    
    0 讨论(0)
  • 2021-02-08 03:32

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

    You must enable the library GD2.

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

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

    The line should look like this:

    extension=php_gd2.dll

    Then restart apache and you are ready to go.

    0 讨论(0)
  • 2021-02-08 03:33

    This is because the GD Library is missing on your server For PHP 8.x

    For PHP 8.x try the following:

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

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

    The line should look like this:

    extension=gd
    

    Then restart apache and you are ready to go.

    NOTE: If You are using php version <=7.x

    ;extension=php_gd2.dll, itshould look like this: extension=php_gd2.dll

    0 讨论(0)
提交回复
热议问题