You are here: Re: [PHP] Executing command in Linux « PHP « IT news, forums, messages
Re: [PHP] Executing command in Linux

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация