Read this carefully as it may help find a solution to the captcha problem we are experiencing:
just like many of you, I can not get the captcha image to appear in my forms. I discovered several problems that are causing this:
1. Check for errors in the script.
go directly to this address were the script is running..... NOT YOUR FORM, but the script and see what error shows up in your browser:
www.yourdomain.com/components/com_forme/captcha.php Be sure to use your domain in that url, not the one I just included.
I receive an Internal Server Error. Did you? If you have access to your server via command line You can troubleshoot this error better by using the following command via SSH to follow the Apache error log:
tail -f /usr/local/apache/logs/error_log
Once you have done that, refresh the URL in your browser where I told you to view the captcha.php script a few times and the error should become clear when you look back at your logs in the ssh screen.
Here is the first error I came accross in the log file:
SoftException in Application.cpp:544: Directory \"/home/public_html/components\" is writeable by group
[Wed Jun 25 10:37:34 2008] [error] [client ipaddress] Premature end of script headers: /home/public_html/components/com_forme/captcha.php
[Wed Jun 25 10:37:34 2008] [error] [client ipaddress] File does not exist: /home/public_html/500.shtml
This error confirms the permissions were set wrong. As stated in the post above, the permission need to be set to 755 so there is no group writeable for both the captcha.php file and the folder it is contained in.
OK, so I did this and then went back to my form page to see if the image would appear....... still no image. Now, I decide to go back to the script page:
www.yourdomain.com/components/com_forme/captcha.php and see what errors might be lurking.
Here is what I found:
Warning: imagecreatefromjpeg(./gfx/errorsign.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/public_html/components/com_forme/captcha.php on line 167
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/public_html/components/com_forme/captcha.php on line 168
‰PNG IHDRX‚ ’$ÿPLTEÿÿÿUÂÓ~ŽIDAThíÒ± Ã0@QÜdF3Tdó !
From the error:
Warning: imagecreatefromjpeg(./gfx/errorsign.jpg)
It appears that there is not a file existing at the following path:
/home/public_html/components/com_forme/gfx/errorsign.jpg
looking at the actual file captcha.php at lines 167 & 168 here is what they say:
$errorsign = imagecreatefromjpeg('./gfx/errorsign.jpg');
imagecopy($image, $errorsign, 1, 1, 1, 1, 180, 120);
So................ I search the files & directories of both my installation on the server and the original zip file I purchased from rsforms. I can not find any file or forlder \"gfx\" or errorsign.jpg
did I miss something? Can anyone the author/programmer offer any solution for this? Were these files to be included in the purchased download version?
If anyone has any ideas, please post them here so we can get this handy script to work with the captcha function.
Mikeyb