Get file out of www directory with php

April 11, 2014 1.3k views
I am working on a control panel for a game server and hence keeping config files in the www directory is the worst thing I could probably do. I need to access a file called latest.tx in /srv/ So, how do I do it?
2 Answers
to answer to this question requires more details.
Do you have Su-Exec ? Does PHP run under mod_php or PHP-FPM?
also what chroot uses (if it uses) Apache as well as PHP.
http://www.php.net/manual/en/function.chmod.php

BTW:
and please do not post again as an answer to "https://www.digitalocean.com/community/questions/any-real-private-networking-solution" if you do not understand what I'm talking about.
Try reading /srv/latest.tx, e.g. file_get_contents('/srv/latest.tx');Assuming the user apache is running as (most likely www-data) has access to read the file, it should work.
Have another answer? Share your knowledge.