$captcha = new Zend_Captcha_Image(array(
'font' => BASE_PATH .'/fonts/Average-Regular.ttf'
));
$captchaId = $captcha->generate();
in index.php
// Define path to application directory
defined('BASE_PATH')
|| define('BASE_PATH', realpath(dirname(__FILE__) . '/../'));
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
error:
Warning: imagepng(): Unable to open
‘./images/captcha/564749fc943b090f6d38233071ae1538.png’ for writing:
No such file or directory in
/var/www/html/workbench/zend/library/Zend/Captcha/Image.php on line
563
try this.
you need to define the image directory in which you will be storing the captcha images.
for more information check out the documentation http://framework.zend.com/manual/en/zend.captcha.adapters.html#zend.captcha.adapters.image