Arrow

No Image Appearing | Peter's Custom Anti-Spam for WordPress | Forum

Back to the custom anti-spam plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
No Image Appearing
November 30, 2008
3:52 pm
Allan
Guest

Peter - I had this installed on a different server and it was working. I’ve since switched to a different host and I’m getting errors.

CAS says it’s seeing GD and FreeType, but no images are appearing. On my server logs I’m getting the following errors:

[Sun Nov 30 12:21:39 2008] [error] [client 207.6.246.81] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php:319) in /home/xxx/wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 345, referer: http://xxx/

[Sun Nov 30 12:21:39 2008] [error] [client 207.6.246.81] PHP Warning: imagettftext() [function.imagettftext]: Could not read font in /home/xxx/wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 344, referer: http://xxx/

[Sun Nov 30 12:21:39 2008] [error] [client 207.6.246.81] PHP Warning: imagettfbbox() [function.imagettfbbox]: Could not read font in /home/xxx/wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 319, referer: http://xxx/

Same error if PNG graphics are selected or not. I tried the solution you gave to Arif (changing line 314 to fail) and it will show the imagechar generated text.

Any suggestions on where to look? I’m assuming that my host is not configured correctly but don’t know where to start.

Thanks

-Allan

November 30, 2008
6:43 pm
Peter
Admin
Forum Posts: 841
Offline

Hi Allan,

Try re-uploading the fonts in binary mode rather than ASCII mode. The fact that it mentions the font makes me think that's the likely solution, barring a server configuration oddity.

November 30, 2008
6:48 pm
Allan
Guest

Hi Peter - thanks for the advice. I re-loaded everything (fonts as binary files) before I posted and this didn't help. I also tried using the Javascript to pull the files down.

I tried out your Math Antispam and it works! So I spent a bit of sleuthing time and found that the following path wasn't valid
$cas_fontpath = 'fonts/';

I changed it to the absolute path and it now works:
$cas_fontpath = $cas_folder. '/fonts/';

Not sure why it doesn't like the relative path but it doesn't. Probably the way FreeType is set up.

Strangely enough the sound path works just fine the way it is.

Thanks for the help and the great plugin!

-Allan

November 30, 2008
6:57 pm
Allan
Guest

I think there's still something wrong - it's working but giving the imagechar text. I'll post when I figure out why.

Thanks again,

-Allan

November 30, 2008
10:30 pm
Peter
Admin
Forum Posts: 841
Offline

Hi Allan,

I’m guessing that the relative font path wasn’t the problem, because it is later combined with the plugin path to create an absolute path. Without further investigation, I can’t say what it could be, though [Image Can Not Be Found]

Good luck! If you could post back when the time comes, that would be great, to help people who might end up in a similar situation in the future.

December 1, 2008
12:27 am
Allan
Guest

Okay, now I'm pretty sure I'm on crack because this doesn't make sense.

The reason imagechar characters were showing up was because I had a double / in the path - so it dropped out of the if statement and went straight to imagechar as it should.

However more troubleshooting later, and I discover it's something like a path length issue... if I chanve line 141 to

$cas_fontpath = '';

and copy the font files to the peters-custom-anti-spam-image directory from the fonts/ directory, it works.

When I put the fontpath back to 'fonts/' it errors out.

When I change the fonts directory name to 'font' and put that in the path, it errors out.

When I change the fonts directory to 'pig' and use that in the path, it errors out.

I don't get it. I'm going to talk to my hosting provider to see what's up.

Thanks,

-Allan

December 1, 2008
1:18 am
Peter
Admin
Forum Posts: 841
Offline

Perhaps this is something like an open_basedir restriction? In other words, the host's PHP settings only allow files to access other files within the same directory. I would have thought it returned a different error than you experienced, but it's certainly a possible reason. I am glad it is working for you now, though!