#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    118
    Rep Power
    7

    FOpen permission denied


    Array ( [type] => 2 [message] => fopen(TestFile.txt): failed to open stream: Permission denied [file] => /home/vhosts/king-trading.freeoda.com/CSS_Creator/my_css.php [line] => 3 )

    Just was doing a simple fopen test and it denies it.
    Code:
    <?
    $myFile = "TestFile.txt";
    $fh = fopen($myFile, 'w') or die(print_r(error_get_last(),true));
    $stringData = "Floppy Jalopy\n";
    fwrite($fh, $stringData);
    $stringData = "Pointy Pinto\n";
    fwrite($fh, $stringData);
    fclose($fh);
    
    ?>
    The file does exist though. Any idea how to fix this error?
  2. #2
  3. Jealous Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,302
    Rep Power
    9400
    Does PHP have permissions to write to the file? Try changing its permissions to 0666.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    118
    Rep Power
    7
    Ahh, forgot about that permission setting.. thanks
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Ahh, forgot about that permission setting.. thanks
    but...but...
    FOpen permission denied

    Array ( [type] => 2 [message] => fopen(TestFile.txt): failed to open stream: Permission denied [file] => /home/vhosts/king-trading.freeoda.com/CSS_Creator/my_css.php [line] => 3 )

    Just was doing a simple fopen test and it denies it.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo