In my code I need to create a file and write a string onto the file. The directories on my site have mode as 755 ( only the owner having permission to write , not the group and public ). Only when i change the permission and give permission to write to the public , I am able to create the required file using standard fopen , fputs and fclose functions respectively. When I create such a file the owner is appearing as \'nobody\'.
Well .... this is not the ideal way of doing as i cannot give permission to write to the public for security reasons of course.
I need to know how can I create a file where the owner is not \'nobody\' but the admin who has permissions to write !!!!

One thought was to use fsockopen function , though i am not sure. Have tried using but not worked !! may be i used it the wrong way.

Any help on this is welcome and appreciated !!

Thanks in advance.

    Hi SGS,

    Did you try php function chmod and chown ?

      Write a Reply...