PHP Captcha Help
Firstly make sure you are using the latest version of the captcha script available on http://www.white-hat-web-design.co.uk/articles/php-captcha.php
Check you have the required GD & FreeType libraries. This can be done by putting the following in a new file and checking the output mentions GD & FreeType
phpinfo();
Perl Formmail
Unfortunately this script cannot be used alongside Perl formmail scripts, you will need to find one written in PHP
Image Not Showing
You can also see if there is an error message produced by adding the line error_reporting(E_ALL); above session_start(); in CaptchaSecurityImages.php then go to CaptchaSecurityImages.php in your browser
If you get the error Warning: imagettfbbox() [function.imagettfbbox]: Could not find/open font in ... then try the following
Ensure you have uploaded the monofont.ttf file into the same directory as CaptchaSecurityImages.php. Add the line
putenv('GDFONTPATH=' . realpath('.'));
to the top of the CaptchaSecurityImages.php file, above session_start();
Also try changing the line
var $font = 'monofont.ttf';
to
var $font = 'monofont';
Alternatively try setting the font variable as a full path to the font on your server, e.g
var $font = '/home/user/public_html/monofont.ttf';
Still Having Problems?
If you are still having problems using this script please email us, we can't guarantee we'll get back to you straight away, but we'll try our best.
You can help us identify the problem quicker if you provide the following details shown in the phpinfo() output:
- Information on PHP version
- Configure Command
- Information from the GD & FreeType sections
If you find this script useful then please consider linking to us or why not make a donation to the developer via paypal.




