CAPTCHA Not Working

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

CAPTCHA Not Working

Post by LaneLester »

All I'm seeing in the CAPTCHA is lines, no characters. This is in Firefox and IE.

Also, I am unable to disable the CAPTCHA function. I uncheck the box in Admin, save the change, but the box remains checked, and the CAPTCHA request is still displayed to the user.

phpMyFAQ Version phpMyFAQ 2.0.0-RC
Server Software Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
PHP Version PHP 4.4.6

Lane
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: CAPTCHA Not Working

Post by Thorsten »

Hi,
All I'm seeing in the CAPTCHA is lines, no characters. This is in Firefox and IE.
Can you post your phpinfo() page?
Also, I am unable to disable the CAPTCHA function. I uncheck the box in Admin, save the change, but the box remains checked, and the CAPTCHA request is still displayed to the user.
This is already fixed in CVS.

Thanks for testing!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

System Linux juno.nswebhost.com 2.6.17.11-grsec #2 SMP Mon Sep 11 06:45:23 EDT 2006 i686
Build Date Mar 31 2007 17:42:12
Configure Command './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-pdflib' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pgsql=/usr' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib' '--enable-fastcgi'
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,
LaneLester wrote:'--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf'
you're mixing different TTF libraries in your PHP... I don't know if this breaks something... I think it's breaking something because you don't see any characters in the captcha.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

Thorsten wrote:you're mixing different TTF libraries in your PHP... I don't know if this breaks something... I think it's breaking something because you don't see any characters in the captcha.
Too bad, I'd like to use the system with captcha for the security. I have other sites with captcha on the same server; I guess they use a different approach (seen here).

Lane
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you try this esample if this is working on your server?

http://de3.php.net/manual/en/function.imagettftext.php

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

When I upload the file to the server and then execute this:
http://www.newsandvie.ws/function.imagettftext.php
I get a page that lists a zillion php functions and then a section that starts with this:

imagettftext
(PHP 4, PHP 5)
imagettftext — Write text to the image using TrueType fonts
Description
array imagettftext ( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text )

Writes the given text into the image using TrueType fonts.

Lane
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you create a test.php file with the following content and open the file inside your browser:

Code: Select all

<?php
// Set the content-type
header("Content-type: image/png");

// Create the image
$im = imagecreatetruecolor(400, 30);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);

// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';

// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);

// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?> 
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

This is what I get:

Firefox:
The image “http://www.newsandvie.ws/captchatest.phpâ€
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the arial.ttf file have to be in the same folder as the PHP file...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

Thorsten wrote:the arial.ttf file have to be in the same folder as the PHP file...
They are.

And I just figured out the problem: I had gFTP set to upload in ASCII instead of binary. After arial.ttf was uploaded in binary, the test file worked perfectly.

Lane
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you check that for the three .ttf files in the phpMyFAQ font/ folder, too?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
LaneLester
Posts: 10
Joined: Mon Apr 30, 2007 1:05 pm
Location: Georgia, USA

Post by LaneLester »

Thorsten wrote:can you check that for the three .ttf files in the phpMyFAQ font/ folder, too?
That was it!

My usual practice is to upload everything except the images folder as ASCII. I guess I need to watch out for those TTF's!

Lane
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

ah, great!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply