note 80217 deleted from function.include by nlopess
| From: | nlopess@php.net | Date: | Fri, 04 Jan 2008 14:51:14 +0000 |
| Subject: | note 80217 deleted from function.include by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134770@lists.php.net to get a copy of this message | ||
Note Submitter: WereCougar
----
I was having tremendous problems with "Permission Denied" errors, when trying to include()
a file from within a symbolically-linked directory, like so:
<?php
// this tosses 'Permission Denied' errors
include('/www/site/includes/file.php');
// this works fine
include('/var/www/site/includes/file.php');
?>
Note: "/www" is a symlink to "/var/www"
This also happens on require(), include_once(), and require_once().
I searched in vain for hours trying to figure out if it was a PHP problem, an OS problem, or an
Apache problem. I chmod-ed everything properly, chown-ed everything properly, and still nothing
would allow me to include() a file.
It turns out that my fresh install of CentOS 4.4 had additional security measures in place
(SELinux). It's enabled by default, and when I turned this off, everything worked perfectly. I
would imagine this also happens on Red Hat Enterprise Linux as well.
How to disable SELinux:
http://www.howtoforge.com/perfect_setup_centos_4.4_p3