Installation of Magento 2 error: php ext-gd is required

Installation of Magento 2 error: php ext-gd is required

July 23, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Installation of Magento 2 error: php ext-gd is required

Installing Magento 2: Resolving the PHP Extension GD Issue

If you’re attempting to install Magento Commerce Edition Open Source (previously called Community Edition) on your Cloud9 instance running Ubuntu 14.04 with PHP 7.0, you might encounter an error regarding the required ext-gd extension.

Understanding The Error

The error message clearly states that Magento requires the GD extension to be installed in your PHP environment:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for magento/product-community-edition 2.1.3 -> satisfiable by magento/product-community-edition[2.1.3].
    - magento/product-community-edition 2.1.3 requires ext-gd * -> the requested PHP extension gd is missing from your system.

The GD Extension: What It Is and Why It’s Required

The GD library provides a way for PHP to manipulate images and create graphics on-the-fly. Magento uses it primarily for image-related operations like product image resizing, watermarking, and thumbnail generation.

Checking Your Current PHP Configuration

To verify which PHP.ini files are being used by your current setup, you can run the command:

php --ini

This will display information about the configuration file(s) that are loaded for PHP in CLI mode. Make a note of these paths; they may vary depending on how you installed PHP.

Resolving The Issue

You’ve already attempted to install php70-gd following the StackOverflow guide, which is a great starting point. However, let’s walk through the process again with some additional steps:

  1. Update your package list:

    Before anything else, make sure your system’s package list is up-to-date:

    sudo apt-get update
    
  2. Install the required dependencies:

    Install the necessary packages that GD requires to function properly:

    sudo apt-get install php7.0-gd php7.0-imagick ghostscript
    
  3. Restart your PHP-FPM service:

    After installing, you need to restart the PHP-FPM service for the changes to take effect:

    sudo systemctl restart php7.0-fpm
    
  4. Verify the installation:

    You can check if GD is enabled by creating a simple PHP file (e.g., gd_test.php) with this content:

    <?php
      phpinfo();
    ?>
    

    When you navigate to this page in your browser, look for the “GD Information” section. If it’s present and displaying details about GD version 2.x or later, then the installation was successful.

Troubleshooting Common Issues

If you’re still encountering problems after following these steps, here are a few things you can check:

  • Check your php.ini file: Ensure that extension=gd is uncommented (i.e., not preceded by a semicolon) in the appropriate php.ini file.

  • Refresh your Magento cache: After installation, clear your Magento cache to ensure it reloads without errors. You can do this via SSH:

    php bin/magento cache:clean
    

Conclusion

Successfully installing Magento 2 requires careful attention to your PHP environment and extensions. The GD library is a critical component for many image-related features in Magento.

Remember, keeping your system up-to-date with the latest security patches and maintaining a clean, optimized codebase are key best practices when working with Magento on LaravelCompany’s hosting platform or any other PHP-based e-commerce solution.

If you’re looking to optimize your Magento setup further or need expert assistance with extensions like GD, consider our professional services at https://laravelcompany.com/magento-services/. Our team of experienced developers can help ensure your Magento installation runs smoothly and efficiently.

Magento 2 Catalog Extensions Configuration

Our network