monteoma Posted October 7, 2009 Share Posted October 7, 2009 Hi guys, I'm developing a web application to read some files that are included in my intranet the problem is that all the time I'm getting the next error: "failed to open stream: Permission denied" and is impossible to read them. I'm using apache web server running on winxp and my php version is 5.3.0. I'm using to do that the next code: <?php $file = fopen("//servername/shared/TMPFiles/file.txt","r") or exit("Unable to open file!"); while(!feof($file)) { echo fgets($file). "<br />"; } //some code to be executed fclose($file); ?> In fact my text file called file.txt has permissions for reading and writing. Any suggestion to solve it? Thanks in advanced! Quote Link to comment https://forums.phpfreaks.com/topic/176891-please-help-me-with-this-error-message-failed-to-open-stream-permission-denied/ Share on other sites More sharing options...
chronister Posted October 7, 2009 Share Posted October 7, 2009 I may be wrong, but are UNC paths supported?? I did not realize that they are. I would start with your path. I have fought with this error before and it always ended up being a path issue. Nate Quote Link to comment https://forums.phpfreaks.com/topic/176891-please-help-me-with-this-error-message-failed-to-open-stream-permission-denied/#findComment-932699 Share on other sites More sharing options...
MadTechie Posted October 7, 2009 Share Posted October 7, 2009 Try mapping the network drive to a letter then see what you get.. also try changing apache service LogOn, from system to "this account" Quote Link to comment https://forums.phpfreaks.com/topic/176891-please-help-me-with-this-error-message-failed-to-open-stream-permission-denied/#findComment-932700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.