Arrow

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

Back to the custom anti-spam plugin page
 
Current User: Guest
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

No Image Appearing

Reply to Post Add a New Topic
UserPost

3:52 pm
November 30, 2008


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

6:43 pm
November 30, 2008


Peter

Admin

posts 732

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.

6:48 pm
November 30, 2008


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

6:57 pm
November 30, 2008


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

10:30 pm
November 30, 2008


Peter

Admin

posts 732

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 (

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.

12:27 am
December 1, 2008


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

1:18 am
December 1, 2008


Peter

Admin

posts 732

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!

Reply to Post

Reply to Topic:
No Image Appearing

Guest Name (Required):

Guest Email (Required):

HTML Editor
Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
9 + 8