0

So this is my code: http://pastebin.com/3jELA420 I'm trying to store my password using phpass and for some reason the included file is not being accessed in my else statement. I get the error: Fatal error: Class 'PasswordHash' not found in /home/carlton/public_html/PHPproject/forms/registersecure.php on line 33

This is related to a thread I posted not too long ago (Registration page: Storing password using PHPASS), but I feel like this is more succinct thread as I feel I have isolated the problem.

Community
  • 1
  • 1
  • 1
    are you absolutely sure that there is a file "/home/carlton/public_html/PHPproject/includes/PasswordHash.php" ? and it contains the PasswordHash class ? – Paul Bele Apr 24 '14 at 04:55
  • Try using "require_once" instead of "include" for your file. – Scopey Apr 24 '14 at 04:59
  • using require_once changes the error to this: string(0) "" Warning: require_once(/home/carlton/public_html/PHPproject/includes/PasswordHash.php): failed to open stream: Permission denied in /home/carlton/public_html/PHPproject/forms/registersecure.php on line 4 Fatal error: require_once(): Failed opening required '/home/carlton/public_html/PHPproject/includes/PasswordHash.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/carlton/public_html/PHPproject/forms/registersecure.php on line 4 – carlgoodtoseeyou Apr 24 '14 at 05:00
  • You don't have read access on that file. You will need to `chmod` the file so that the user your apache runs under can read the file. The user that your apache runs under is usually something like `www-data` – Scopey Apr 24 '14 at 05:01

1 Answers1

0

Based on your respond, PHP doesn't have enough permissions to access the file : Please read more about it here

Also please check this responses

Please try:

chmod /home/carlton/public_html/PHPproject/includes/PasswordHash.php  755
Community
  • 1
  • 1
Paul Bele
  • 1,514
  • 1
  • 11
  • 12