Closed (fixed)
Project:
CAPTCHA
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2007 at 04:29 UTC
Updated:
10 Mar 2016 at 19:32 UTC
Jump to comment: Most recent
Comments
Comment #1
soxofaan commentedDo the other captcha types (math, text) work (show to untrusted users, block on wrong answer, submit on right answer)?
Does your setup involves proxies or other web page caching mechanisms?
Try commenting line 207 (or close to 2007) of image_captcha.module:
Comment #2
mike15 commentedI've tried enabling math & text for user_reg and I see the following questions so it appears to be working although I didn't verified if it accepts my answers.
Math Question: What is 1 + 1?: *
What is the second word in the captcha phrase "vebufas simuwi vadu fugo oqoje"?: *
Yes, I am utilizing eAccelerator:
PHP 5.2.1 (cli) (built: Apr 1 2007 15:20:56)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
I've tried disabling the line recommended but don't see any images other then a captcha field asking to enter the phrase from the image.
Comment #3
soxofaan commentedalso comment line 196:
// unset($_SESSION['image_captcha']);The thing is that the image can only be generate once (to prevent misuse and pollution of the session variables). With line 196 commented, the image can be generated multiple times (and there shouldn't be any caching/proxy problems). The distortions in the captcha image will actually be different every time, only the depicted code will be the same.
Also dive into the html of the challenge and try to get the url of the image. Can you see an image if you paste that url in your browser?
Comment #4
mike15 commentedHmm, I disable the line 196 still no luck seeing any images on the page.
The url of image appears to be pointing @http://www.domain.com/image_captcha/2002202705. Even if you try accessing this URL, I get a blank screen.
I've also tried looking at the web server logs which appear to be ok:
Using Firefox:
192.168.10.1 - - [02/Aug/2007:18:40:31 -0400] "GET /image_captcha/2002202705 HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; U; Mac; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
Using Safari:
192.168.10.1 - - [02/Aug/2007:18:42:21 -0400] "GET /image_captcha/2002202705 HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; U; Mac; en) AppleWebKit/419.2.1 (KHTML, like Gecko) Safari/419.3"
Comment #5
soxofaan commentedIs it a blank screen or do you get a pale yellow image without text? If so, the image captcha can't find the ttf font. Did you change settings in the image captcha configuration page? Try to save these settings at least once (you don't need to change something), do you then get an error message that the font can't be found? Also check if there are any fonts in the fonts subdirectory of the image captcha modue.
No error messages whatsoever? Is error reporting disabled or something? Without error messages it is difficult to guess what's wrong.
Does the mycaptcha module (http://heine.familiedeelstra.com/mycaptcha-download) work? The image captcha of the rewritten captcha module is based on that. Disable all captcha modules first before enabling mycaptcha.
Does the textimage module (http://drupal.org/project/textimage) work? Just try the text->image functionality, not the captcha of that module (it won't work anymore probably).
Comment #6
heine commentedYour PHP interpreter needs to be compiled with support for the FreeType library.
Check whether phpinfo lists the following entries under GD:
To view phpinfo, make a file (eg info.php) with the code below then visit it (http://example.com/info.php).
Comment #7
mike15 commentedI have checked my php.ini and it didn't appear that PHP was compiled with FreeType fonts. So I've recompiled the PHP and included the '--with-freetype-dir=/usr/local/lib' without any issues.
I've checked the GD section after compiling the PHP and I still don't necessarily see any references to FreeType:
GD Support enabled
GD Version 2.0 or higher
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
Also, looking at the web server logs, seeing some php errors:
[Tue Aug 07 15:07:10 2007] [error] [client 10.10.1.1] PHP Fatal error: Call to undefined function imagettfbbox() in /webroot/modules/captcha/image_captcha/image_captcha.module on line 361, referer: http://www.site.com/user/register
Comment #8
pmc2000 commentedI was having the same problem as you described. No images being created for image captcha.
I used a previous php build and had forgotten to run 'make clean' before rebuilding with freetype. Now image captcha is working fine.
Comment #9
mike15 commentedI want to thank everyone who help me resolve this issue. The 'make clean' is what got me this time around. As previously noted, my PHP was not compiled with FreeType and GD was not aware of FreeType fonts to use.
I recompile PHP with the following settings:
After you compile, I now have the following under GD:
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.5
Thanks, again!
Comment #10
(not verified) commentedComment #11
prasannah.ganeshan commentedIt was a very useful comment. I was able to reconfigure my server with GD and now it's working.
Comment #12
jerinpd commentedComment #13
soxofaan commentedat jerinpd in #12:
Please do not change the version flag of this thread, without giving more information why you want to change it
Moreover, CAPTCHA 6.x-1.x is unsupported, use the CAPTCHA 6.x-2.x branch for Drupal 6
Comment #14
mrfreshly commentedI had this issue pop up recently. After poking around and debugging for a while, I discovered Clean-URLs was disabled for the particular site that was throwing blank/broken image_captcha images. This resulted in the $_GET['sid'] param not getting through.
instead of:
/image_captcha?sid=161&ts=1435533445
it was doing:
/?q=image_captcha&sid=161&ts=1435533445
I'm not sure why it's not properly dealing with the url_encoded string, didn't really look any deeper...But, just enabling Clean-URLs put the sid as the first parameter and made it happy enough to work...(I don't think ts is really used by captcha)
Comment #15
sydneyjane commentedThanks, #14 worked for me (on Drupal 7.x).