Welcome Guest, Not a member yet? Register   Sign In
create_captcha not working
#1

[eluser]luisfmgoncalves[/eluser]
Hello guys.

So, I'm having this issue with the create_captcha function.
I have 2 machines with my application: a Centos machine (the main server) and a Ubuntu machine (the development machine).

In the Ubuntu machine everything is working ok, but in the Centos machine I get a Database error. I followed the CAPTCHA Helper in the User guide and my code is something like this:

Code:
$vals = array(
   'img_path' => './captcha/',
   'img_url' => base_url() . 'captcha/',
   'img_width' => 150,
   'img_height' => 30
);

$cap = create_captcha($vals); ---> error

But I got a Database error in the create_captcha function:

Code:
Column 'captcha_time' cannot be null
insert into captcha(captcha_time, ip_address, word) values (NULL,'xx.xx.xx.xxx',NULL)

The function is failing because something is wrong with the paths in Centos, I guess.
The images will be stored in a folder captcha in the root of my project. I changed the permissions of that folder for drwxrwxrwx.

Any clues of what might be wrong?

Thanks,

Luis

PS:
CentOS release 5.5 (Final)
mysql Ver 14.14 Distrib 5.1.44
nginx/0.7.65
#2

[eluser]luisfmgoncalves[/eluser]
The problem was because the system administration installed php (the fpm version) with the '--without-gd' flag.
So, in the documentation says that CAPTCHA need the GD library.
After a 'yum install php-gd' everything start working.

Thanks.
#3

[eluser]Nur Cholikul Anwar[/eluser]
First: check your captcha directory to 777 access
Second: install php-gd




Theme © iAndrew 2016 - Forum software by © MyBB