Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on setting up PHP 5.4, and I've set a library up in /usr/share/php/ I've set include_path='.:/usr/share/php', and was not able to include anything with a relative require_once.

I've set the include up to the explicit path, and get a permission error, even after chmoding the file to 777.

failed to open stream: Permission denied

Is there something I'm missing?


Here are the permissions for the file I'm trying to include:

drwxrwxrwx. 64 1001 1001 4096 Sep 29  2011 Zend

-rwsrwsrwt.  1 1001 1001  12959 Mar  1  2011 Config.php

And the two require lines I tried:

share|improve this question
What distribution? SELinux/AppArmor? – Kyle Smith Apr 3 '12 at 16:52
@Kyle Smith CentOS 6.0. No AppArmor or SELinux – Ben Dauphinee Apr 3 '12 at 17:04
up vote 1 down vote accepted

check if you have execution permission on the folder your lib is sitting in you need to enable apache(or whatever web server you are using) with execution permission on the folder containing the files you want to include/require

share|improve this answer
Chmodded the folder as well, and still get the same error. – Ben Dauphinee Apr 3 '12 at 16:46
could you paste the output of ls -la command that shows permissions on the lib you want to include and the folder containing it and also the lines of php code you are using for the require once ? – m0ntassar Apr 3 '12 at 16:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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