SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Edinburgh, UK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    files created for user other than "nobody" or "www"

    Hi All,

    Just wanted advice on something.

    I have to interact with the file system with the application I'm writing and need to be able to create files and modify them as I like.

    Fwrite() and fopen() will always creates files with permissions for user "nobody", "www", "httpd", (or whatever). I don't want these files with permissions set to these users but I want to be able to control what "user" will the file belong to.

    How can I do that?? I'm looking at the ftp functions of php to use. Am I on the right track here ??

    Any short suggestion would be great!!

    Is there something like fwrite() in the ftp functions of php??

    Thanks for the help!
    R.
    Geza Turi

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can change the file owner with the function chown. However it's only the superuser that can change it though.

    -Helge

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Edinburgh, UK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. In the mean time I have already did it with the ftp functions.

    >> However it's only the superuser that can change it though.

    Than you would need to change under what username PHP runs!??

    I don't get it

    You can change the file owner with the function chown. However it's only the superuser that can change it though. But php runs as "nobody", "www", "httpd"
    which are not superusers.

    Should php be runing under a superuser username !?? If not than how would one use chown ?
    As you see I lack of experience
    Thank you for you help!

    Geza


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
  •