$captcha = new Zend_Captcha_Image(array(
'font' => BASE_PATH .'/fonts/Average-Regular.ttf'
));
$captchaId = $captcha->generate();
的index.php中Zend_Captcha_Image套牢字體包括路徑
// 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'));
錯誤:
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
什麼是您存儲字體的目錄路徑? – 2012-07-24 04:32:46
它駐留在根文件夾'/fonts/Average-Regular.ttf' – 2012-07-24 04:41:30
你有另一個常量名稱'APPLICATION_PATH'定義,或者你正在使用'BASE_PATH'而不是'APPLICATION_PATH'? – 2012-07-24 04:46:16