BloodyMind Posted August 1, 2008 Share Posted August 1, 2008 Problem: fopen(C:/wamp/www/phpTask/dataAccess/data.txt) [function.fopen]: failed to open stream: No error in C:\wamp\www\phpTask\dataAccess\dataAccess.inc.php on line 26 Warning: fopen(http://localhost/phpTask/dataAccess/data.txt) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections does anyone got a clue I use windows XP btw if it is a problem with apache Quote Link to comment Share on other sites More sharing options...
damianjames Posted August 1, 2008 Share Posted August 1, 2008 From a user on a different board I googled - the file you're trying to write to is not local it is something like http://xx.xxxxxxxxxx.com/projphotos/5.jpg even if this is your host, you cannot write by http, you have to use the local file system to write files it seems $images_dir contains http://xx.xxxxxxxxxx.com/projphotos/ when it should contain realpath("projphotos") or something similar I searched for the string "failed to open stream: HTTP wrapper does not support writeable connections" Quote Link to comment Share on other sites More sharing options...
mbeals Posted August 1, 2008 Share Posted August 1, 2008 damianjames is sort of right. fopen will work with the html wrapper if allow_url_fopen is turned on. see here: http://us.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen Although this isn't usually a good thing to turn on unless you are sure you really want to. The first error could be caused by lots of stuff. The file doesn't exist...the file lacks proper permissions... Looking at some actual code would help a lot. Quote Link to comment Share on other sites More sharing options...
BloodyMind Posted August 2, 2008 Author Share Posted August 2, 2008 well actually It's coz of permissions I use windows XP and then if i edit the attributes of the file and uncheck the Read Only then when i try to access it again I find read only checked it's something with the apache I guess but I don't think the allow_url_fopen is a good idea I solved it by disabling an apache extention which was authz_file or something like that i can't remember but i'm not sure i'm doing the right solution. and I still find the same issue with directories when i try to write a new file to a directory i always find it read only when i uncheck it I find it read only again :S Thanx guys for trying to help Quote Link to comment 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.