Enabling/installing GD extension? --without-gd

2020-02-26 02:41发布

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() output "Core" that lists "gd"

PHP Version 5.2.4 on AWS.

8条回答
手持菜刀,她持情操
2楼-- · 2020-02-26 03:01

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

sudo apt-get install php7.0-gd

and than restart your webserver.

查看更多
闹够了就滚
3楼-- · 2020-02-26 03:03

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.

查看更多
来,给爷笑一个
4楼-- · 2020-02-26 03:03

In CentOS (but the same may apply to other distros too) if you install the php7x-gd module followed by Apache restart and still the php -i does not show the GD Support => enabled it might mean that the php.ini was not automatically configured to support this extension.

All you have to to is either to edit the /etc/php/php.ini or to create a /etc/php.d/gd.ini file with the following content:

[gd]
extension=/path/to/gd.so # use the gd.so absolute path here
查看更多
成全新的幸福
5楼-- · 2020-02-26 03:08

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
查看更多
该账号已被封号
6楼-- · 2020-02-26 03:14

For php7.1 do:

sudo apt-get install php7.1-gd

and restart webserver. For apache do

sudo service apache2 restart
查看更多
做个烂人
7楼-- · 2020-02-26 03:16

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)

查看更多
登录 后发表回答