locker — 2011-10-30T06:09:02-04:00 — #1
I've got a permission error which is driving me mad. Here's the error I'm getting:
require_once(/srv/path/include.php): failed to open stream: Permission denied.
Now, the require_once() function is being called from: /home/path/index.php
I've ensured that permissions are correct, even to the extend of running chmod -R 777 on the entire /srv/ directory (now put back, of course).
What could the problem be? Any help would be greatly appreciated!
cups — 2011-10-30T07:41:26-04:00 — #2
it could be a chown issue rather than a chmod issue?
locker — 2011-10-30T08:11:32-04:00 — #3
I also tried chown -R apache:apache /srv to no avail
cups — 2011-10-30T08:18:02-04:00 — #4
Is the server running in safe_mode?
(if you cannot get the ini file, query with ini_get() maybe?)
locker — 2011-10-30T18:23:53-04:00 — #5
I've just checked php.ini and 'safe_mode = Off'.
cups — 2011-11-01T06:10:22-04:00 — #6
is the path :
actually an alias for
or are there more than one /srv/path paths?
(or the other way round, sorry, I'm grasping at straws now)
I came across a similar prob when starting out in *nix, and I kinda got round it by having a PHP script actually write a file say, test.php, then I could just edit it with vim and so on and it worked.
I had put this down to my own ignorance at the time, and figured it must have been a chmod/chown error on my part.
(safe mode enforces matched ownership requirements on files)
Also, check your include_path string very carefully, there are diffs between *nix / win32 handling of slashes, separators ( ; or : ) etc.
Try setting include_path at the script level with ini_set();
locker — 2011-11-12T18:14:42-05:00 — #7
Thanks for your help again but unfortunately nothing is working - this is really driving me crazy!
If anyone else has any idea please let me know.