fopen() fails to open stream: permission denied, yet permissions should be valid

前端 未结 2 876
小鲜肉
小鲜肉 2021-01-18 03:15

So, I have this error:

Warning: fopen(/path/to/test-in.txt) [function.fopen]: failed to open stream: Permission denied

Performing ls

2条回答
  •  一生所求
    2021-01-18 04:15

    Check if the user that PHP runs under have "X" permission on every directory of the file path.
    It will need it to access the file

    If your file is: /path/to/test-in.txt
    You should have X permission on:

    • /path
    • /path/to

    and read permission on /path/to/test-in.txt

提交回复
热议问题