Welcome Guest, Not a member yet? Register   Sign In
No way to make capcha work on localhost
#1

[eluser]RiccardoC[/eluser]
I was working with captcha, but there's no way to obtain the array I need in local (on the web it work)
Here is my code
Code:
$vals = array(
  'img_path' => 'C:/mywebzone/captcha/',
  'img_url' => base_url() . 'captcha/',
);  
$captcha = create_captcha( $vals );
I also used
Code:
'img_path' => 'C:\\mywebzone\\captcha\\'
and
Code:
'img_path' => './captcha/';
Whatever I try, the $captcha variable contain an empty string (not an array as expected)
The strange things is that if I put the code on the server, it work perfectly and the $captcha variable contain the expected array

Any idea?
#2

[eluser]RiccardoC[/eluser]
another information
I tried this
Code:
$handle = fopen("c:\\mywebzone\\captcha\\prova.txt", "w");
fclose($handle);
$handle = fopen("./captcha/xxx.txt", "w");
fwrite( $handle , "Prova testo" );
fclose($handle);
And it worked perfectly, thus it looks like it is not a folder auth problem
#3

[eluser]RiccardoC[/eluser]
Solved! The GD extension wasn't loaded in my PHP
This is the solution (for other dumb like me people Wink )

open your php.in file (usually c:\php folder)
look for this line
Code:
;extension=php_gd2.dll
Remove the semicolon and it will look like this
Code:
extension=php_gd2.dll
Restart your apache server and all will work properly!




Theme © iAndrew 2016 - Forum software by © MyBB