Linux Tutorial
Linux File/Directory Management
Linux Packaging And Compression
Vim Text Editor
Linux Text Processing
Linux Software Installation
Linux User/User Group Management
Linux Permission Management
Linux Filesystem Management
Linux Advanced Filesystem Management
Linux System Management
Linux Backup and Recovery
Linux System Service Management
Linux System Log Management
Linux Boot Management
LAMP/LNMP Environment
SELinux Management
The GD library is an open-source graphics library that allows you to create, edit, and manipulate images dynamically in various file formats like JPEG, GIF, and PNG. In this tutorial, we will go through the steps to install the GD library on Linux systems.
To install the GD library on Debian or Ubuntu-based systems, use the following commands:
sudo apt-get update sudo apt-get install -y php-gd
After the installation, restart the Apache web server for the changes to take effect:
sudo systemctl restart apache2
To install the GD library on CentOS or RHEL-based systems, use the following commands:
sudo yum update sudo yum install -y php-gd
After the installation, restart the Apache web server for the changes to take effect:
sudo systemctl restart httpd
To install the GD library on Fedora-based systems, use the following commands:
sudo dnf update sudo dnf install -y php-gd
After the installation, restart the Apache web server for the changes to take effect:
sudo systemctl restart httpd
To verify if the GD library has been successfully installed, create a new PHP file (e.g., info.php
) in your web server's document root (usually /var/www/html
) with the following content:
<?php phpinfo(); ?>
Now, open your browser and navigate to the info.php
file using your server's address (e.g., http://your_server_ip/info.php
). Search for "gd" on the page, and you should see the GD library's details, indicating that the installation was successful.
Remember to remove the info.php
file after verifying the installation, as it may expose sensitive information about your server.
sudo rm /var/www/html/info.php
That's it! You've successfully installed the GD library on your Linux system. You can now use it to create and manipulate images dynamically in your PHP applications.
How to install GD Library on Linux:
sudo apt-get install libgd-dev
Installing GD Library for image processing in Linux:
sudo yum install gd-devel
Linux GD Library installation steps:
sudo apt-get install libgd-dev # For Debian-based systems
GD Library package installation in Linux:
sudo pacman -S gd
Dependency resolution for GD Library on Linux:
sudo apt-get install -f # Fix missing dependencies on Debian-based systems
Compiling and installing GD Library from source on Linux:
# Assuming you've downloaded the source tarball tar -zxvf gd-x.x.x.tar.gz cd gd-x.x.x ./configure make sudo make install
Checking GD Library version after installation in Linux:
gdlib-config --version
Configuring PHP with GD Library support on Linux:
sudo apt-get install php-gd