Re: [PHP] Executing shell commands

This is a discussion on Re: [PHP] Executing shell commands within the PHP General forums, part of the PHP Programming Forums category; On Sun, 2003-11-09 at 03:41, Teren wrote: > > Hi, I'm trying to write a front ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-09-2003
Robert Cummings
 
Posts: n/a
Default Re: [PHP] Executing shell commands

On Sun, 2003-11-09 at 03:41, Teren wrote:
>
> Hi, I'm trying to write a front end for something and I want to be able
> to execute shell commands. I tried all of the pre-written functions
> and non of them would work. I setup a user that can sudo and then i
> set apache to run as that user. So, what I tried to do is
> shell_exec("sudo -s; reboot;"); but that didn't work, I also tried
> other numerous variations all of which didn't work (also using exec(),
> system(), passthru() ). If any one has any ideas how i can do this,
> please let me know. Thanks


I believe this has been answered quite recently and the large consensus
was to have a daemon (cron or otherwise) check for some status file or
database entry, which when set it would perform the required function.
So for instance to reboot the machine, perhaps a cron job would check
for the existence of /tmp/myFrontEnd/reboot and if found reboot the
machine. Thus the front end would only need to create the file.

HTH,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0