Spam Protector Issue: Captchas not showing!!

Found a bug? Tell us!!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

There is something wrong with gdlib, you got an old version which is why the Plugin shows PNG files instead of creating an own image. Your gdlib does not support the function 'imagettftext".

But it should still just loop through the files, I don't understand that.

Please try to replace

Code: Select all

echo file_get_contents($cap);
with this:

Code: Select all

$fp = fopen($cap, 'r');
if (!$fp) {
    header('X-Permissions: Error for ' . $cap);
} else {
    $cont = fread($fp, filesize($cap));
     header('X-Permissions: Read ' . filesize($cap) . ' bytes from FP');
     echo $cont;
     fclose($fp);
}
And then once again report back so I can analyze the headers :-D

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pano
Regular
Posts: 24
Joined: Tue Apr 05, 2005 11:15 am

Post by pano »

Changed!
Let's see...
pano
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Now the headers emit a missing filename - I suppose you broke something with the code? Can you please post what your code looks like from line 757 on until the end of that 'else' block?

Maybe it would even be good if you could provide me with FTP access to your s9y installation, then I could check the code? If you want to do that, please contact me privately.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gizmola
Regular
Posts: 37
Joined: Mon Oct 25, 2004 11:54 pm

Post by gizmola »

I have a similar problem currently that I'm trying to work out, and one way to help debug is to have warnings turned on, and then to take a captcha url and execute that directly.

What I've found is that the problem lies in my freetype support.-- it's not working for some reason.

Here's an example:

http://www.gizmola.com/blog/plugin/capt ... ff43c53579

Running this shows:

The image cannot be displayed because it contains errors.... etc

Viewing source on the page, I note the problem:

<br />
<b>Warning</b>: imagettftext(): Could not read font in <b>/sites/gizmola.com/blog/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>: imagettftext(): Could not read font in <b>/sites/gizmola.com/blog/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />

<b>Warning</b>: imagettftext(): Could not read font in <b>/sites/gizmola.com/blog/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>: imagettftext(): Could not read font in <b>/sites/gizmola.com/blog/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>: imagettftext(): Could not read font in <b>/sites/gizmola.com/blog/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>750</b><br />

I'm doing some work on my gentoo install, and will explore this further when things are stabalized there. This smells like a gd/freetype/php configuration installation issue.
dakira
Regular
Posts: 20
Joined: Tue May 25, 2004 4:21 am

Post by dakira »

hi,

did you resolve this issue, yet? I upgraded the php installation on my server since I needed GD2 for some other software. I don't get the captchas anymore, either and I agree it must have to do with either gd or freetype. I'll try reinstalling the latter and recompile my php. Hopefully this helps because I really need the new php but still would like to keep my captchas..
dakira
Regular
Posts: 20
Joined: Tue May 25, 2004 4:21 am

Post by dakira »

mhh.. compiling php takes soo long ;( I hope it's worth it..
Rahul

CAPTCHA not working for me too...

Post by Rahul »

Hey...
CAPTCHA is not working for me too...
Seems to have some problem.
When i try to click on "View Image" in Mozilla, it displays the error....

The Image "http://172.19.60.26/serendipitydemo/ind ... c53e4f52cb" cannot be displayed because it contains errors"

I read all the discussion that took place.
But nothing worked for me.

Please help me out in enabling the CAPTCHA !!!!!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Hi Rahul.

Your URL does not work for me: No route to host.

Please post a working one, and a link to your phpinfo() output please.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Rahul

CAPTCHA not working for me too...

Post by Rahul »

Sorry dear.
I'm working in my company and i'm using this on intranet.
Please tell me what do u want exactly and i'll tell u the output.

Please guide me and i'll reply u with the things u want to know.

I had weekend off. So, cudn't reply early.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Okay, you need to do a full WGET dump of the captcha URL and send that file ZIPped somewhere so I can look at it. Or you look at the output yourself, there will be some PHP notices within that dumped file. Those in return will tell you what is wrong with your PHP installation. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rahul

CAPTCHA not working for me too...

Post by rahul »

what is this WGET Dump? It went over my head.... :oops:

please tell me in detail.

Thanks in Advance.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Rahul: Google for "wget". You need to fetch the URL with the captcha with an external program that dumps the whole files; unlike Browsers which already interpret the stuff, wget can capture the raw HTTP traffic data and dump it to a file.

It's complicate, which is the reason why I asked for your URL in first instance. :)

If your server supports allow_url_fopen you can use this simple script:

Code: Select all

<?php
$c = file_get_contents('http://172.19.60.26/serendipitydemo/index.php?/plugin/captcha_173e551ca376c1c7e95f5ac53e4f52cb');
$fp = fopen('captcha.txt', 'w');
fwrite($fp, $c);
fclose($fp);
?>
Save this snippet was "wget.php", then open your HTTP http://localhost/wget.php (replace localhost with your webserver) and then it will write a captcha.txt in the same directory where wget.php is in. That captcha.txt is what I need then. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lubinio

Similar Problems

Post by lubinio »

Hi,
Sorry to inundate you with another person asking for help but I'd be grateful if you could assist me with a similar issue... my blog displays a blank image for the captcha.

Do I need to install ImageMagick or will it work without it?

The blog's available at http://www.lyulph.net/blog/

Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Similar Problems

Post by garvinhicking »

lubinio: It seems that you have not properly configured "GDLib" for your PHP. You need to have the freetype extension also installed for the captchas do work. You seem to be running quite a strange setup because the image itself is created but it's white on white! So I guess that the *.tff Files are not properly inserted.

Can you contac tyour hoster and ask how he configured GDLib? You can also have a look at the <?php phpinfo(); ?> output and give me a link to it.

ImageMagick is not used for the Captcha, it's independent form that.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
lubinio

Re: Similar Problems

Post by lubinio »

PHP Info is available at http://www.lyulph.net/phpinfo.php

When you say the image is created white on white, do you mean that the text is the same colour as the background? I've changed the background of the captcha as is now visible to no avail.

Is there any way I can check for the .tff files?

Thanks for your help.
Post Reply