Add PHP GD support on a Linux server with Plesk

PHP is one of the popular web programming languages.

ADVERTISEMENTS

The Plesk software package is a commercial web hosting automation software. It allows to setup set up new websites, email accounts, and DNS entries through a web-based interface.

The php gd package contains a dynamic shared object that will add support for using the gd graphics library to PHP. If users are using popular CMS software such as WordPress, you need GD support.

Adding GD graphic libraries support to php is quite easy job w/o breaking Plesk software.

Red Hat Enterprise Linux

Type following two command as root user:
# up2date php-gd
# /etc/init.d/httpd restart

Cent OS or Fedora Core Linux

Type following two command as root user:
# yum install php-gd
# /etc/init.d/httpd restart

Verify that php gd support loaded

Type any one of the following command:
# php -m | less
# php -m | grep gd

You can also use phpinfo() to verify that php gd loaded and working perfectly.

Now, your web server should up and runing php with GD 🙂

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
15 comments… add one
  • Larry Boehm Nov 21, 2006 @ 21:21

    I love you.

    I was about to re-install apache, php, etc..and saw that all I need to do was yum php-gd, then restart apache.

    Did I tell you I love you?
    Thanks

  • Jeff Hester Jan 4, 2007 @ 4:47

    You are a GOD! Thank you for this — I can’t believe it was so friggen easy.

  • 🐧 nixCraft Jan 6, 2007 @ 12:55

    Jeff,

    Some time small things bugs out badly – php-gd is one of them.

    Appreciate your post.

  • Hankster Mar 11, 2007 @ 18:43

    WOW

    Thats freaking amazing how simple it was. I was for the past 3 hours looking how to Reconfigure php and apache to install gd.

    You are brilliant.

  • kyaw min htet Mar 24, 2007 @ 13:22

    Thanks alot.That amazing command i never known.

  • AnonymousCoward Jul 29, 2007 @ 18:45

    Hi,

    I did a yum install php-gd
    php -m | grep gd shows gd.

    phpinfo() shows GD when from command line, but does NOT when accessed via Apache. any clues ?

  • 🐧 nixCraft Jul 29, 2007 @ 19:51

    It should work if you see gd using phpinfo or command line. See error log for more information.

  • Prashant Apr 1, 2008 @ 5:52

    Thanks a ton :)!!!

  • Sumith May 30, 2008 @ 11:49

    hi Vivek,

    in my case php-gd is already installed but its not listing in phpinfo.php.
    plz go thru the following out outputs.

    # rpm -qa | grep -i php
    php-cli-5.2.4-1.fc7
    php-gd-5.2.4-1.fc7
    php-mbstring-5.2.4-1.fc7
    php-snmp-5.2.4-1.fc7
    php-5.2.4-1.fc7
    php-dba-5.2.4-1.fc7
    php-ldap-5.2.4-1.fc7
    php-pdo-5.2.4-1.fc7
    php-ncurses-5.2.4-1.fc7
    php-odbc-5.2.4-1.fc7
    php-soap-5.2.4-1.fc7
    php-xmlrpc-5.2.4-1.fc7
    php-pear-MDB2-2.4.1-2.fc7
    php-magickwand-1.0.1-1.fc7
    php-common-5.2.4-1.fc7
    php-bcmath-5.2.4-1.fc7
    php-imap-5.2.4-1.fc7
    php-mysql-5.2.4-1.fc7
    php-pear-1.5.0-3
    php-xml-5.2.4-1.fc7
    php-pear-MDB2-Driver-mysqli-1.4.1-3.fc7

    # php -m | less

    PHP Modules]
    bcmath
    calendar
    ctype
    date
    dom
    filter
    ftp
    hash
    iconv
    imap
    json
    libxml
    mysql
    pcre
    posix
    Reflection
    session
    SimpleXML
    sockets
    SPL
    SQLite
    standard
    tokenizer
    xml
    xmlreader
    xmlwriter
    zlib

    Can help me to fix this issue

    Thanks
    Sumith

  • Shane Jun 28, 2008 @ 1:48

    You are the Man !!!! thanx a lot plus a thousand times!!!!

  • 11am Apr 8, 2009 @ 21:33

    # up2date php-gd
    does not work in my RH Linux 5

  • jeffatrackaid Apr 14, 2009 @ 15:47

    RHEL 5 uses Yum not up2date.

    Depending on your server provider, you find find a large number of PHP-* modules missing. Always try to get them via yum/up2date before looking to 3rd parties.

    There are some 3rd party RPMs out there for specific functions. I recommend you use them with caution.

  • ee Sep 20, 2009 @ 1:52

    thanks!

  • Farshid Oct 27, 2010 @ 11:43

    That was perfect… It does really work…

  • Retz Sep 5, 2011 @ 7:49

    Hi!

    Thanks a lot for this thread. I was able to install php-gd on my server.

    More power!

    God bless you!

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.