.htaccess pcfg_openfile: Linux- unable to check htaccess file, ensure it is readable and that public_html is executable

I am on ENTOS 7.6 xen.

In order to fix some permissions error n files I ran the following while staying on the parent folder to public_html

chown -R mysiteaccount:mysiteaccount public_html

After I ran this command the following error started to appear:
htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘public_html/’ is executable

I wondered what happened and then with the help of some internet sources I figured out that I had changed the apache user from nobody to mysiteaccount. I remember running the same chown command on public_html would work at may other occasions fine but this time.

Fixing htaccess pcfg_openfile error in Centos

In order to fix this I navigated to the parent folder of public_html and ran the following:

chown mysiteaccount:nobody public_html

And it worked!

(Note that there is not recursive option passed, means it would change the owner of public_html folder only and of nothing inside it)

Leave a Reply