I am not very familiar with CentOS and its specific permissions issues with httpd+php environment so that I got stuck with "failed to open stream: Permission denied" after installing website on production server.

I have directory layout like that

/usr/local/project ... /usr/local/project/../../public

/var/www/html -> /usr/local/project/../../public ^ symlink

Script tries to write to project's sub directory and gets permission denied error.

I have tried

1) set 744 permissions for this folder 2) set 777 for entire project's tree 3) set open_basedir to /usr/local/project in combination with previous permissions changing

Nothing helped.

What can cause permissions error?


Check if you have SELinux enabled? If yes then disable it


| improve this answer | |
  • thx, it solved problem – duganets Feb 11 '11 at 13:33
  • Hi, still at 2016, on Redhat Enterpise 7, this is true and useful. – Patricio Nov 7 '16 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.