title: How do I add HTTP authentication to a PHP-based Heroku app?
body: <p>I am attempting to add HTTP authentication to my php-based Heroku app. I found a great Github gist <a href="https://gist.github.com/bbrewer97202/3316425" rel="nofollow">here</a> that provides code for creating .htaccess and .htpasswd files in my Heroku directory. I currently have both files within the /app/ directory (so .htaccess is located at /app/.htaccess and .htpasswd is located at /app/.htpasswd). However, when I navigate to my app and enter in the username and password, I get a 500 internal server error. Checking the Heroku logfile, I can see only that my .htpasswd file was not found:</p>
  
  <p>(2)No such file or directory: [IP removed] AH01620: Could not open password file: /app/.htpasswd</p>
  
  <p>Here is the full contents of my .htaccess file:</p>
  
  <p>AuthUserFile /app/.htpasswd
  AuthType Basic
  AuthName "My Files"
  Require valid-user</p>
  
  <p>If I run bash on heroku and 'ls -a', I can see that my .htpasswd file is definitely in the /app/ directory.</p>
  
  <p>Someone has any idea what is going on here? Is there something that I'm missing in terms of getting this set up?</p>