GD Library extension not available with this PHP installation Ubuntu Nginx

后端 未结 6 784
南方客
南方客 2020-12-24 02:01

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 <

相关标签:
6条回答
  • 2020-12-24 02:13

    for php -v 7.1

    sudo apt-get install php7.1-gd
    

    works for me

    0 讨论(0)
  • 2020-12-24 02:21

    For my fellow Windows users, find the line ;extension=gd2 in your php.ini file and change it to extension=gd2.

    Regards

    0 讨论(0)
  • 2020-12-24 02:24

    @limonte's answer is correct, but if you're using PHP7+, you should use following command:

    sudo apt-get install php7.0-gd

    If you don't know what version of PHP you're using, just type

    php -v

    Output should start with something similar to PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS ).

    0 讨论(0)
  • 2020-12-24 02:25

    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

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

    php -i | grep -i gd
    

    Output should be like this:

    GD Support => enabled
    GD headers Version => 2.1.1-dev
    gd.jpeg_ignore_warning => 0 => 0
    
    0 讨论(0)
  • 2020-12-24 02:33

    In my case under Archlinux:

    pacman -S php-gd 
    

    php-gd

    then in your php.ini for me in /etc/php/php.ini uncomment line ;extension=gd.so by removing semicolon.

    Don't forget to restart the server.

    0 讨论(0)
  • 2020-12-24 02:35

    Php 5.6 worked with below command

    PHP5.6: sudo apt-get install php5.6-gd

    after installing restart server

    sudo service apache2 restart
    
    0 讨论(0)
提交回复
热议问题