my codeigniter captcha not generating image
The problem is that you are passing $this->data
to your view but you are assigning the image generated to $data
. So you need to change it from
$data['image']= $cap['image'];
to
$this->data['image']= $cap['image'];
If that doesn't work then make sure the captcha directory you are saving the image to ('img_path' => './captcha/'
) is writable, either 666 or 777. You can do this be doing chmod 777 captcha/
on the command line. Also make sure that the GD image library extension is enabled in your php.ini