I am hoping someone can help me or shed some light on an issue I am facing.
I am running into a permission denied issue with trying to access a file via IP. When I access the file through the DNS name everything is fine. The problem is that on the production system I can't use the DNS name.
Here is some sample code to show you what I am doing: (these are just sample sharenames and IPs, but I have verified that the share IP is correct)
$file = '\\\\mysharename\files\sample.txt';
echo $file.'<br>';
if(@fopen($file, 'r'))
{
echo 'file exists <br>';
}
else
{
$error = error_get_last();
echo $error['message'];
echo '<br>Does not exist';
}
$file = '\\\\10.10.0.1\files\sample.txt';
echo $file.'<br>';
if(@fopen($file, 'r'))
{
echo 'file exists <br>';
}
else
{
$error = error_get_last();
echo $error['message'];
echo '<br>Does not exist';
}
The output:
\mysharename\files\sample.txt
file exists
\10.10.0.1\files\sample.txt
fopen(\10.10.0.1\files\sample.txt) [function.fopen]: failed to open stream: Permission denied
Does not exist