Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Sunday, April 23rd, 2006 at 4:16pm

Checking for GD support on your server

Several of the scripts and plugins on this site use the GD library to generate verification images. If you are having problems getting a generated image to display, the first step is to make sure your server has support for the GD library in PHP. This small script will tell you if your server supports GD, and if it does, it will list the specific components. For example, some versions of PHP/GD have problems generating PNG files. You can use this script to know if you need to change the script to generate a GIF instead, or if you just do not have support at all for GD.

Live Demo

Download

Instructions

Download the above file, rename it from .txt to .php, upload it to your server, and open it in your browser.

Topic: Scripts | RSS Feed

  1. 31
    Darken

    Thanks for this little tool.

  2. Cool I made fully basic testing scirpt based off your tester for GD. Makes easyer for iwndows users to turn on things like curl and GD. Good work and thank you for the share!

  3. unknown: You may have to recompile Apache with PHP included.

  4. does your check GD script work for php_gd2.dll?….because i enabled it in php.ini and told php.ini where to find the dll but your test GD script says its not installed…I’ve verified that i correctly configured php.ini but still no GD according to your script.I also used php info script and GD doesn’t show up in it neither.

  5. Jack: I see you have verification removed right now on your form. Send me an email when you have it enabled and I will check something.

  6. formmailer_verify.php will not display verification #
    gd-test.php was run and I contacted support/ GD PNG & GIF
    are both supported, session cookies are enabled but it
    is still not working ??

  7. Ray: To disable verification in the formmailer script, set the veirfication field option to “” and remove the verification line from the form structure.

  8. I apologize, but a couple of times you mention in the website… “read above to learn how to disable GD.” and I can’t find where you have laid out those steps… For now I just deleted the line about verification. But it still gives me the error message. How can I disable GD so it stops giving me the error message at the top of the contact page… textorservice.com | contact. Thanks for your help. Great code by the way.

  9. george: If you do not have direct access to the server (to recompile Apache), you will just have to ask your web host to see if they can enable GD for you.

  10. hi i would like some help i have tryed the script and GD is not supported how do i get it to work thanks

  11. Thanks, useful script!

  12. Terje: The non-caching code has actually already been added to the new version of my formmailer script/plugin (as well as new session code), although it is not ready for public release yet. It will also be added to the guestbook script eventually when I have time to update that one :)

  13. 19
    Terje With Lunndal

    To avoid the verification image being cached, and thereby not changing to the user, one could add two lines of code to the start of ddbb.php:

    
    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    

  14. 18
    Terje With Lunndal

    Everyone who are experiencing issues with displaying the verification image should first check if session cookies are enabled for the site in question. The author might want to mention this in the documentation and the script output.

  15. Virginia: When I go to that link I get an error - perhaps it is some sort of re-direction code in your .htaccess file? Try going to that link.

  16. 16
    Virginia

    Yes the file is there.

  17. Virginia: The script on your server is looking here for the verification file:

    http://www.yukasato.net/formmailer_verify.php

    The problem is that the file is just not there. Did you upload it?

  18. 14
    Virginia

    I have it up at http://www.yukasato.net/links.php
    Sorry it took a while to respond :)

  19. Virginia: There are many possible reasons :) Can I see a link? You can email it to me if you prefer.

  20. 12
    Virginia

    I have done everything listed here successfully(gd supported, php mail works) and the image still doesn’t show up on one site I am doing(it works on my other site). Is there anything else anyone can think of as to why the image doesn’t show up?

  21. Matt: No. It should work fine in all browsers, unless there is another issue you are having. :) Please post this on the proper page though.

  22. Oops - Secure Form Mailer Plugin For Wordpress

    thanks Admin, but I just noticed that it is showing up on my work computer (Internet Explorer). I was using firefox at home when I posted, and tried reloading the page, too - are there any issues w/ the mozilla browser (CSS, etc)?

    thanks

  23. Matt: You are going to have to tell me what plugin/script you are trying to use. There are a few different ones that make use of the image verification. Please leave a comment on the page for the script in question. :)

  24. Regarding previous comment, forgot to mention I tried alt version of verify already - no dice…

  25. I am not seeing any verification code - uploaded the file to my server to test as you instructed and received the following.

    GD is supported by your server!
    GD Version Yes
    FreeType Support Yes
    FreeType Linkage Yes
    T1Lib Support No
    GIF Read Support Yes
    GIF Create Support Yes
    JPG Support Yes
    PNG Support Yes
    WBMP Support Yes
    XBM Support Yes
    JIS-mapped Japanese Font Support No

    by dagondesign.com

    Shows just like the demo file on your server… what can I do next to determine the cause of the image not showing?

    Thanks,

  26. Maya: You will have to contact your web host and see if they can enable sending mail through PHP. There is not much you will be able to do yourself unfortunately.

  27. ok i get this message:
    Warning: mail(): “sendmail_from” not set in php.ini or custom “From:” header missing in D:\hshome\chefilan\chefilan.com\blog\wp-content\plugins\test.php on line 1

    i guess it’s not supported. how can i make it work?

  28. Maya: Save the following code as test.php, upload it, and open it in your browser. Then check your mail :)

    <?php mail('your@email.com', 'Subject', 'Message'); ?>

    Be sure to add in your email address of course.

  29. what can i do to check that?

  30. Maya: I have not seen this happen before, but after a bit of searching, it looks like it is usually caused by PHP not being configured to send mail. Do you know if your server supports the use of the mail function from PHP?

  31. i don’t want any verification. i removed it from the form successfully, but now when i send the message i keep getting this error:

    Warning: mail(): “sendmail_from” not set in php.ini or custom “From:” header missing in D:\hshome\chefilan\chefilan.com\blog\wp-content\plugins\intouch\dd-formmailer-plugin.php on line 700

    about a missing header..
    any idea what this is?

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.