Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Open a terminal window on your Ubuntu machine.

  2. Update the package list by running the following command:

sudo apt-get update

  1. Install the PHP GD package by running the following command:

sudo apt-get install php-gd

  1. After the installation is complete, restart the Apache web server by running the following command:

sudo systemctl restart apache2

  1. Verify the installation by creating a simple PHP script that uses the GD library. For example, you can create a script called test.php with the following code:

  1. Save the script in the /var/www/html directory and access it in a web browser by navigating to http://localhost/test.php. If the script displays a "Hello, world!" message in a PNG image, the installation was successful.