Skip to main content
Inspiring
February 22, 2011
Answered

How do I install (or check that I have) gd library

  • February 22, 2011
  • 1 reply
  • 2957 views

I read another post on this, but didn't understand how to check if I have GD Library. I want the library to work on an image script that needs GD library.

I'm on a Mac, and have MAMP 1.9.4 installed.

I'm reluctant to install the PHP module at http://www.entropy.ch/software/macosx/php/ because I don't want to screw anything up. (My original problem with MAMP was I installed extra stuff not knowing what it was...)

Thanks in advance for your patience (and simply worded response for a REAL novice.)

Jami

This topic has been closed for replies.
Correct answer Günter_Schenk

Let´s first check if the GD library is enabled on your local server:

1. create a new *blank* PHP file, put the line

<?php phpinfo(); ?>

..in here, and store this file (example: info.php) inside the MAMP "htdocs" folder

2. open "info.php" with your browser (should be "http://localhost/info.php" I assume)

3. you should now see a page which reveals your current PHP configuration settings including compilation options and enabled extensions. I´m attaching a screenshot which indicates what you should get to see on this page in case the GD library is enabled.

1 reply

Günter_Schenk
Günter_SchenkCorrect answer
Inspiring
February 22, 2011

Let´s first check if the GD library is enabled on your local server:

1. create a new *blank* PHP file, put the line

<?php phpinfo(); ?>

..in here, and store this file (example: info.php) inside the MAMP "htdocs" folder

2. open "info.php" with your browser (should be "http://localhost/info.php" I assume)

3. you should now see a page which reveals your current PHP configuration settings including compilation options and enabled extensions. I´m attaching a screenshot which indicates what you should get to see on this page in case the GD library is enabled.

Inspiring
February 22, 2011

Thanks. Yes -- it says

GD Support    enabled
GD Version    bundled (2.0.34 compatible)

Under Configure Command I didn't find quite the same thing your screenshot showed.

I put the two that referenced "gd" in orange

  './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php5.3' '--exec-prefix=/Applications/MAMP/bin/php5.3' '--sysconfdir=/Applications/MAMP/conf/php5.3' '--with-soap' '--with-config-file-path=/Applications/MAMP/conf/php5.3' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007e' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip'

?

Thanks -- Jami

Günter_Schenk
Inspiring
February 22, 2011

Under Configure Command I didn't find quite the same thing your screenshot showed.

This doesn´t matter, because I´m running something else (XAMPP) on a Windows OS, and PHP configurations do vary pretty much.