On Wednesday 09 July 2003 19:29, Steve Jackson wrote:

> > 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.

Think about it, permissions are there for a reason -- to prevent users from 
doing what they shouldn't be doing.

> 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?

Run the script as root. Not recommended, unless you know what you're doing.

> This will allow me to generate a file on the fly.

But _why_ do you need to write to the root directory? Why not just write to a 
directory where you *do* have permission to write to?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The University of California Statistics Department; where mean is normal,
and deviation standard.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to