Page 2 of 3

Posted: Tue Apr 05, 2005 12:00 pm
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

Posted: Tue Apr 05, 2005 12:02 pm
by pano
Changed!
Let's see...

Posted: Tue Apr 05, 2005 12:40 pm
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

Posted: Thu Apr 14, 2005 1:21 am
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.

Posted: Thu Apr 21, 2005 3:20 am
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..

Posted: Thu Apr 21, 2005 3:43 am
by dakira
mhh.. compiling php takes soo long ;( I hope it's worth it..

CAPTCHA not working for me too...

Posted: Fri Apr 29, 2005 2:06 pm
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 !!!!!

Re: CAPTCHA not working for me too...

Posted: Fri Apr 29, 2005 2:09 pm
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

CAPTCHA not working for me too...

Posted: Mon May 02, 2005 8:24 am
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.

Re: CAPTCHA not working for me too...

Posted: Mon May 02, 2005 10:40 am
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

CAPTCHA not working for me too...

Posted: Tue May 03, 2005 1:01 pm
by rahul
what is this WGET Dump? It went over my head.... :oops:

please tell me in detail.

Thanks in Advance.

Re: CAPTCHA not working for me too...

Posted: Tue May 03, 2005 7:00 pm
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

Similar Problems

Posted: Tue May 03, 2005 8:47 pm
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!

Re: Similar Problems

Posted: Tue May 03, 2005 8:52 pm
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

Re: Similar Problems

Posted: Tue May 03, 2005 9:06 pm
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.