close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

Enabling the GD library setting

Tutorial created by Ray Borduin, WebAssist

Categories: Data Bridge, eCart, PHP

rating

Many features that you see on the web require that the GD library be enabled on your PHP server. You may need the GD library if you are
attempting to display CAPTCHA graphics somewhere on your site.

In a default PHP installation, the GD library should already be enabled.

The following tutorial explains how to determine if the GD library is enabled on your PHP server, and how you might be able to turn this on.

arrow downWhat Do You Need to Start?

  1. PHP Testing Server

arrow downIs GD turned on?

You can check to see if the GD library is enabled by creating a simple phpinfo page on your web server.

  1. Create a new file called
    phpinfo.php
  2. Open this file in Notepad, or your preferred WYSIWYG editor such as Dreamweaver.
  3. Add the following line of code:
    <?php
    phpinfo();
    ?>

  4. Save your file within your local web server.
  5. Open a web browser such as Firefox or Internet Explorer.
  6. In the Address bar, enter the URL to this file.
    Typically, on your local testing server, this will be http://localhost/phpinfo.php.
  7. If the GD library is enabled, the resulting page should display the following section.

    If you don't see the above section, please refer to the PHP manual for the steps needed to install GD.

    1. http://us2.php.net/manual/en/image.installation.php

arrow downInstalling GD

Below are a few common examples on how to install GD.

Windows Server users

  1. Open your PHP.ini file in Notepad, or your preferred WYSIWYG editor.
    This file is normally located in the C:\Windows\ directory.
  2. Locate the following line.
    ;extension=php_gd2.dll

  3. Remove the preceding semicolon (;) to enable the option.
  4. Save your file.
  5. Restart the web server.


Ubuntu Linux users

  1. Run the following command to install GD:
    sudo apt-get install php5-gd

  2. Restart your Apache web server.


Mac OSX users
For Mac OSX users, there is not a simple solution for enabling the GD library after PHP installation is complete. Instead, we recommend that you use MAMP, which you can obtain from the following location.

  1. http://www.mamp.info/en/downloads/index.html


MAMP allows you to install Apache, MySQL and PHP for testing your websites locally.

arrow downReviews and comments

Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.

Sign in to add comments
rating
rating

: 10 Years, 7 Months, 4 Weeks, 2 Days, 13 Hours, 50 Minutes ago

Tank you for your information, perfectly clear and easy to follow !

gor.denish: 10 Years, 6 Months, 2 Weeks, 2 Days, 14 Hours, 48 Minutes ago

gd library php download

gor.denish: 10 Years, 6 Months, 2 Weeks, 2 Days, 14 Hours, 48 Minutes ago

Thank You

: 7 Years, 9 Months, 3 Days, 13 Hours, 3 Minutes ago

How can I Enable Webp support in php GD library in xampp on linux?
I have XAMPP for Linux 7.0.8*
And enabled with GD Support.
I want to use `imagewebp();`.
I have error while using this,
Fatal error: Uncaught Error: Call to undefined function imagewebp()
while searching for a solution I have concluded with is solution from http://php.net/manual/en/image.installation.php
> webp | To enable support for webp add --with-vpx-dir=DIR . Available as of PHP 5.5.
I want to enable webp support.
What I want to do?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.