I am using Linux 12.04,apache and php is installed on it.I want to access a text file in /root/ folder.I am really confused with the permissions.The php script i m using
<?php
$file = fopen("/root/cr.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br>";
}
fclose($file);
?>
This script is able to access the file /var/www folder but not able to access /root/ip.txt file. Please help and explain step to step possible.