Not able to open a file in php
Don't forget that even if Apache's been granted permissions to read the file, you also have to grant Apache access to ALL of the parent directories.
/path/to/file//path/to/path
all need to grant Apache at least 'Read' permission.
You're sure that apache
is the user actually running your PHP?`
And: make sure that the apache
user can reach some_file.txt
in the file system and that it isn't blocked by some access restriction on directories above some_file.txt
.
Before you go to fix an error, it would be nice to know, which error to fix.
Add these lines at the top of your script and then try again
ini_set('display_errors',1);error_reporting(E_ALL);
PHP will tell you, what is the problem