Jump to content

Permission Warning with fopen/file_put_contents


kratsg

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.