Hey guys, I’m trying to use recaptcha on local host. I got a global public/private key and I’m using this code:
<form name="registration_form" method="post" action="register.php" onsubmit="return Validate();"><input type=hidden name=todo value=post>
<table>
<tr><td class="label">First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td class="label">Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td class="label">E-Mail Address:</td><td><input type="text" name="email"></td></tr>
<tr><td class="label">Username:</td><td><input type="text" name="username"></td></tr>
<tr><td class="label">Password:</td><td><input type="password" name="password"></td></tr>
<tr><td class="label">Password Confirmation:</td><td><input type="password" name="password_confirmation"></td></tr>
<?php
require_once('recaptchalib.php');
$publickey = "****"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
<tr><td class="label"><input type="submit" value="Register"></td></tr>
</table>
</form>
Recaptchalib is in the same place as signup.php so that’s not the problem. But after Password confirmation, i get nothing. A blank page.
Here’s the error.
Warning: require_once(/var/www/JMToday/recaptchalib.php): failed to open stream: Permission denied in /var/www/JMToday/signup.php on line 44 Fatal error: require_once(): Failed opening required ‘recaptchalib.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /var/www/JMToday/signup.php on line 44
Ensure that the /var/www directory has read permissions for the user you run your web server as.
Alternatively, run:
which will give total control to the owner of the file and read rights to anyone else.