SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot amit290's Avatar
    Join Date
    Oct 2001
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HELP file creation - permission denied(?)

    Hi

    Im having some difficulty understanding how to create files on host server (unix). I got some very simple code together to test if it would work, but I get the message "permission denied". I've had a look at the manual, but it doesnt make sense. Can any1 help?

    Here is the code I used:

    PHP Code:
    $content="<html><body>some text here</body></html>";

    $fp=fopen("/home/WWW/docs/sometestfile.htm","w");
    fputs($fp,$content);
    fclose($fp); 
    Error message I get:

    Warning: fopen("/export/WWW/docs/sometestfile.htm", "w") - Permission denied in /export/WWW/docs/cp/config/functions.inc.php on line 273

    Warning: Supplied argument is not a valid File-Handle resource in /export/WWW/docs/cp/config/functions.inc.php on line 274

    Warning: Supplied argument is not a valid File-Handle resource in /export/WWW/docs/cp/config/functions.inc.php on line 275


    Thanks

  2. #2
    Custom User Title v1.0 FireFly's Avatar
    Join Date
    Aug 2001
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to make sure that /home/WWW/docs is CHMODED 0777 so PHP will have permission to write (create new files/folders) in it.

  3. #3
    SitePoint Zealot amit290's Avatar
    Join Date
    Oct 2001
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm is that the only option ? !!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •