note 80217 added to function.include
| From: | WereCougar at osu1 dot php dot net | Date: | Fri, 04 Jan 2008 14:10:43 +0000 |
| Subject: | note 80217 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134767@lists.php.net to get a copy of this message | ||
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
----
Server IP: 208.69.120.35
Probable Submitter: 66.152.230.58
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/80217
Del: integrated -- https://master.php.net/note/delete/80217/integrated
Del: useless -- https://master.php.net/note/delete/80217/useless
Del: bad code -- https://master.php.net/note/delete/80217/bad+code
Del: spam -- https://master.php.net/note/delete/80217/spam
Del: non-english -- https://master.php.net/note/delete/80217/non-english
Del: in docs -- https://master.php.net/note/delete/80217/in+docs
Del: other reasons-- https://master.php.net/note/delete/80217
Reject -- https://master.php.net/note/reject/80217
Search -- https://master.php.net/manage/user-notes.php