kratsg Posted July 3, 2010 Share Posted July 3, 2010 Hey Guys, I'm having a problem with a really basic script... it's so basic that I can't imagine what's going wrong at all: $filename = "ip.address"; chdir('../'); $file = fopen($filename,"a+"); The directory looks something like this: -svn/ -public/ --ip.address --html/ ---MYPHPSCRIPT.php I use the chdir('../') to go up one directory (into public/ directory). Inside that is a file called ip.address. Now, I can't even open that file (I can obviously read it as file_get_contents works but I can't write to it). Going with file permissions - I set it to 0777 for the file and it still doesn't work. I'm at a loss. Edit: To clarify, it gives me a "Permission denied in (this php script file) error. Edit 2: allow_url_fopen is set to on for both Global and Local Quote Link to comment https://forums.phpfreaks.com/topic/206597-permission-warning-with-fopenfile_put_contents/ Share on other sites More sharing options...
kratsg Posted July 3, 2010 Author Share Posted July 3, 2010 Hey, So I've tried moving the files into the same directory and still can't get it to work. I'm completely baffled. Quote Link to comment https://forums.phpfreaks.com/topic/206597-permission-warning-with-fopenfile_put_contents/#findComment-1080598 Share on other sites More sharing options...
PFMaBiSmAd Posted July 3, 2010 Share Posted July 3, 2010 Providing addition information would certainly help - 1) What kind of server operating system are you on? 2) What is the full error message (xxxxxx out any information you don't want to post, but post the complete wording of the error message.) 3) allow_url_fopen has absolutely no affect on the code you posted unless you are actually using a URL as the filename, in which case you really need to post your actual code. Quote Link to comment https://forums.phpfreaks.com/topic/206597-permission-warning-with-fopenfile_put_contents/#findComment-1080694 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.