[Tfug] writing files from PHP

Matt Jacob m at mattjacob.com
Thu Jun 19 09:53:41 MST 2008


Paul Scott wrote:
>> If you're unsure of the uid, open the directory permissions to 777,
>> touch() a new file (so that it's created), and set the directory mode
>> back to something sane.  Look at the file owner to see the uid.
> 
>  From a php script?  When I touch a new file from the CLI it works fine 
> and I own the file. 

It has to be from a script executed by Apache so that you can see which 
user httpd is running as. One would hope that you're the owner of a file 
you manually created from the shell. :-)

Let's incentiveize this: first one to solve the problem is getting a 
beer on Paul tonight. :-P

M




More information about the tfug mailing list