SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    St Petersburg, Russia
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    permissions problem (cant open file for writing).

    I use hosting provider for my site. When I test the site on my local computer, the files are opened correctly. But after I upload the site the following error occurs "Warning: fopen(test.txt): failed to open stream: Permission denied in /home/ilyalyu/public_html/test.php on line 4". If I change chmod of the test.txt to 777 using ftp, everything works well. But I cant leeve this chmod because in this case anybody can change the file.

    If anybody can explain how to work with files when you are using hosting provider, I would be grateful.

  2. #2
    SitePoint Enthusiast Redprince's Avatar
    Join Date
    May 2004
    Location
    Salzgitter, Lower Saxony, Germany
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried this?
    Code:
    chmod(file, 0777);
    fopen()....
    chmod(file, xxxx);
    I am not part of the allesburner. I am the allesburner.

  3. #3
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    St Petersburg, Russia
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I tried this. The following error occurs "Warning: chmod(): Operation not permitted in /home/ilyalyu/public_html/test.php on line 7"


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
  •