0

I have 2 domains on the same server and I am trying to access a file on one that is perms 777. I can use file_get_contents with a url but can't do so with a path. What can be preventing this?

4
  • 5
    Please show your code and the error message you get.
    – Cfreak
    Commented Jul 8, 2011 at 19:23
  • 1
    Are you using the full path? eg: /var/www/vhosts/test.com/myfile.png
    – Eddie
    Commented Jul 8, 2011 at 19:23
  • Are you using a directive such as open_basedir? Commented Jul 8, 2011 at 19:25
  • 1
    Check if the user running PHP has access to the directories leading to the file.
    – rid
    Commented Jul 8, 2011 at 19:30

1 Answer 1

3

This really depends on a few different things. If the file is in a seperate folder, outside of the user folder of one site, than it is possible that open_basedir is in effect and is blocking the read attempt. I believe this is the most likely culprit.

Not the answer you're looking for? Browse other questions tagged or ask your own question.