[BlueOnyx:11528] Re: Need CGI script to execute command as root

David Thacker David at ThackerNet.com
Fri Oct 12 11:32:44 -05 2012


Hi Michael,

>> I am a little baffled as to why my existing PHP script fails to create 
>> the
>> symlink with a permissions error when it is running as root. More 
>> testing
>> and/or reading required, apparently...
>
> Neither AdmServ nor Apache run PHP scripts as root. Because that would
> be quite a security risk.

Ahh. I included this in my PHP script for debugging:

    echo get_current_user();

and it spits out "root" when I run via admserv. When I run that same 
script in a regular site it spits out the siteadmin instead of root. 
That's why I thought admserv was running the script as root.

I was thinking the permissions error was related to the restrictions on 
the symlink function when running in safe mode, as per this list: 
http://php.net/manual/en/features.safe-mode.functions.php


Okay, I guess I will pursue the cron job approach as suggested by others.

Regards,

David Thacker 




More information about the Blueonyx mailing list