> On Tue, 2003-07-08 at 07:21, Steve Jackson wrote: > > If I set permissions of my server root to chmod 777 that's > a security > > risk right? How do I set my server to allow me to write a > file to my > > web root from another directory using PHP? Or is it a Unix problem? > > > > I have a generator file writes a string to a text file and then > > renames the text file as a PHP file however it occurred to > me while I > > was doing this that chmod 777 the root might not be a good idea. > > > > Anyone have a simple fix or idea for this? > > Change the ownership on the directory to whichever user > apache is running as (this is the User directive in your > httpd.conf file). Then you can restrict the permissions on > that directory. You could probably make it 600 if you want.
Can this be done automatically with PHP? I want a file to be written to the root directory by PHP and not have to get the web server admin to change ownership privaleges on the root. Basically does anyone know how to get PHP to see what the server name and group is and then assign the writing rights to the script? This will allow me to generate a file on the fly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php