The Linux Page

Apache error: pcfg_openfile: unable to check htaccess file, ensure it is readable

Today I got an error about an .htaccess file that Apache2 could not load.

   pcfg_openfile: unable to check htaccess file, ensure it is readable

I looked like 10 times in that folder to make sure the .htaccess was fine, which meant looking that there wasn't an actual .htaccess file there!

The fact is not exactly that the file cannot be opened, it has more to do with the parent folder accessibility. Somehow Apache2 does not check the parent folder accessibility and prints the error since, indeed, it gets an error other than the usual "File Not Found". (It's getting the "Permission Denied" error and doesn't test that the folder itself is protected...

In my case I just changed the folder permissions with a chmod 755 (a+rx, u+w). In your case you may want to change the group (chgrp www-data ...) or maybe add Apache2 to a new group (see useradd(1) or just edit /etc/group by hand, then restart Apache2. This may not work on all systems though.)

That was it!