Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

EDIT

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

/usr/share/php
drwxrwxrwx. 64 1001 1001 4096 Sep 29  2011 Zend

/usr/share/php/Zend/
-rwsrwsrwt.  1 1001 1001  12959 Mar  1  2011 Config.php

And the two require lines I tried:

require_once('/usr/share/php/Zend/Config.php');
require_once('Zend/Config.php');
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

1 Answer 1

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

 
discard

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.