SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast Locker's Avatar
    Join Date
    May 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    require_once() Permission Error

    I've got a permission error which is driving me mad. Here's the error I'm getting:

    Code:
    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!

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    it could be a chown issue rather than a chmod issue?

  3. #3
    SitePoint Enthusiast Locker's Avatar
    Join Date
    May 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    it could be a chown issue rather than a chmod issue?
    I also tried chown -R apache:apache /srv to no avail

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Is the server running in safe_mode?

    (if you cannot get the ini file, query with ini_get() maybe?)

  5. #5
    SitePoint Enthusiast Locker's Avatar
    Join Date
    May 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    Is the server running in safe_mode?

    (if you cannot get the ini file, query with ini_get() maybe?)
    I've just checked php.ini and 'safe_mode = Off'.

  6. #6
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    is the path :

    /srv/path/

    actually an alias for

    ~/srv/path/

    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();

  7. #7
    SitePoint Enthusiast Locker's Avatar
    Join Date
    May 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Cups,

    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •