I’ve just installed Yii 1.1.4 on my development environment running OS X 10.6.4, Apache 2.2.14, mod_fastcgi/2.4.2, PHP 5.3.2 (I am not using MAMP, these are the latest default Apache/PHP versions bundled with OS X).
After a lot of issues around permissions and file ownerships which I think I have sorted out, I now have the default demo site up and running.
My problem is that the CAPTCHA image is not displaying. I have GD 2 installed and it works fine on other sites. My PHPInfo file gives:
GD Support enabled
GD Version bundled (2.0.34 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 8b
PNG Support enabled
libPNG Version 1.4.3
WBMP Support enabled
XBM Support enabled
Examining the source for the contacts page, I see the HTML is there to place the image, but the image itself is not displayed.
I did do a quick search and didn’t find anything. I’ll look again though, if it saves me the pain of recompiling.
Incidentally, looking at the Contact Form code, I notice that the way Yii is checking whether or not to use Captcha is by doing:
public function rules()
{
return array(
// name, email, subject and body are required
array('name, email, subject, body', 'required'),
// email has to be a valid email address
array('email', 'email'),
// verifyCode needs to be entered correctly
array('verifyCode', 'captcha', 'allowEmpty'=>!extension_loaded('gd')),
);
}
I think it may be better to amend the captcha line to also check for [font=“Courier New”]imagettfbbox()[/font] in the array returned by [font=“Courier New”]get_extension_funcs(‘gd’)[/font]. Is that something that might be worth filing as a change request, do you think?
You can always file an issue at Yii’s google code page if you found something to improve. Worst that can happen, is that it gets rejected by the devs. But usually you get a note why that happens.