Why won't my fwrite() command work?

Discussion in 'PHP' started by Imozeb, Mar 1, 2010.

  1. #1
    Why won't my fwrite() command work? I double checked the script and it is right, I used the proper 'wb' for write. The fread() command works fine but when I try to use fwrite() PHP says "Acess Denied!" Why is this and how can I fix it?
     
    Imozeb, Mar 1, 2010 IP
  2. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #2
    CHMOD the file, you don't have permission to write it D:
     
    Sky AK47, Mar 1, 2010 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I should have permissions, I'm the owner of the website! And I used the is_writable() command to see if the file is writable and it returned true! I don't know if this will help since it already says it is writable but can someone explain to me how to make the file writable to everyone using CHMOD?
     
    Last edited: Mar 1, 2010
    Imozeb, Mar 1, 2010 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    Your php either executes as a user or as nobody. You would run "chmod 777 filename.php" from the command line. Also check the ownership. SSH into the server and switch to the directory the file is in. Run "ls -n" to see the ownership and the permissions of all the files in the directory.
     
    jestep, Mar 1, 2010 IP
  5. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #5
    SSH is too complicated for him, chill lol.

    Just login into your host's control panel, go to the file and look for the CHMOD/permissions checkboxes.
     
    Sky AK47, Mar 1, 2010 IP