Enabling/installing GD extension? --without-gd

后端 未结 9 741
刺人心
刺人心 2020-12-28 11:58

How does one enable (or perhaps I need to install) GD when my phpinfo() output in \"Configure Command\" says; --without-gd ?

I also have nothing in my phpinfo() outp

相关标签:
9条回答
  • 2020-12-28 12:02

    All previous answers are correct but were not sufficient for me on ArchLinux. I also needed to edit /etc/php/php.ini and to uncomment :

    ;extension=gd.so 
    

    The initial ; on the line needs to be removed. After restarting Nginx via systemctl restart nginx, I was good to go.

    0 讨论(0)
  • 2020-12-28 12:09

    if you are on a Debian based server (such as Ubuntu) you can run the following command:

    apt-get install php-gd
    

    Then once it is complete run:

    /etc/init.d/apache2 restart
    

    This will restart your server and enable GD in PHP.

    If you are on another type of system you will need to use something else (like yum install) or compile directly into PHP.

    0 讨论(0)
  • 2020-12-28 12:13

    Check if in your php.ini file has the following line:

    ;extension=php_gd2.dll
    

    if exists, change it to

    extension=php_gd2.dll
    

    and restart apache

    (it works on MAC)

    0 讨论(0)
  • 2020-12-28 12:15

    In my case (php 5.6, Ubuntu 14.04) the following command worked for me:

    sudo apt-get install php5.6-gd
    

    According to php version we need to change the php5.x-gd

    0 讨论(0)
  • 2020-12-28 12:17

    For PHP7.0 use (php7.1-gd, php7.2-gd, php7.3-gd and php7.4-gd are also available):

    sudo apt-get install php7.0-gd
    

    and than restart your webserver.

    0 讨论(0)
  • 2020-12-28 12:20

    If You're using php5.6 and Ubuntu 18.04 Then run these two commands in your terminal your errors will be solved definitely.

    sudo apt-get install php5.6-gd
    

    then restart your apache server by this command.

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