|
Posted by Richard Lynch on 01/18/05 22:34
Rosen wrote:
> Hi,
> I have this problem:
> Linux Red Hat 7.3 server and PHP 4.3.8 & MySQL 4. When I Try to execute
> linux command - nothing happens and in Apache logs I see "Access denied".
> This is about permissions in executing this command.
>
> My question is can I execute a linux command via PHP ( this is command
> allowed only for root user ) ?
>
> P.S. I own this server - i.e. I have user & pass for root.
The PHP user is not root.
The PHP user should *NOT* be root.
Either make that command available to the PHP user, or don't use that
command.
Options for making that command available to the PHP user abound, and
include:
chmod so 'w'orld can eXecute.
Add 'php' group w/ PHP user in it, and chgrp/chmod so 'g'roup can execute.
Use sudo to allow PHP user to run that one command.
Exactly how you choose to do this depends more on your risk assessment,
skill level, and what you are doing than anything else -- None of which
are PHP-related strictly-speaking.
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|