How may I run httpd service as root?
I read your comment but I don't understand how can I compile php with
root permesses...

thanks..



--- In [email protected], "Scott Lingerfelt"
<[EMAIL PROTECTED]> wrote:
>
> Do you have a httpd service running as root?  If so all I do in my
php code
> is:
> 
> $data = exec("some command such as ls -l");
> echo $data;
> 
> or for your program it would be:
> 
> exec("./cdBluez.sh &");  that is if it is a shell script.  Use & if the
> program is to gather data.
> exec("php cdBluez.php");  if it is a php script
> 
> Scott
> 
> 
> On 7/30/08, ssmtux <[EMAIL PROTECTED]> wrote:
> >
> > Hi again,
> >
> > thank you for your replay.
> >
> > could you explain me how did you do that?
> > Because I tried to recompile php with the options that you written
> > down (I put that in the file get_php, does it correct?) but at the
> > moment I'm not able to start bluetooth from my web page....
> > (./cdBluez-start)
> >
> > thank you in advance.
> >
> > --- In [email protected] <foxboard%40yahoogroups.com>, "Scott
> > Lingerfelt"
> > <scott.lingerfelt@> wrote:
> > >
> > > I am running the FoxServe!
> > >
> > > I have not started work on this at this time but I should get
something
> > > together soon! I currently stop the existing httpd service and start
> > > another which runs as root allowing exec("") commands to work.
So a big
> > > security hole! Not to worried that it runs on a local intranet site
> > and not
> > > exposed to the internet.
> > >
> > > Scott
> > >
> > > On 7/23/08, ssmtux <ssmtux@> wrote:
> > > >
> > > > Hello,
> > > >
> > > > thanks in advance.
> > > > May I ask you if with this option also the exec("") could work?
> > > >
> > > > Although I don't understand where I could manage the following:
> > > > --disable-all \
> > > > --with-config-file-path=/etc/ \
> > > > --enable-pdo \
> > > > --enable-session \
> > > > --with-pdo-sqlite \
> > > > --enable-posix \
> > > > --enable-pcntl \
> > > > --enable-discard-path
> > > >
> > > > Regards.
> > > >
> > > > --- In [email protected]
<foxboard%40yahoogroups.com><foxboard%
> > 40yahoogroups.com>, "Scott
> > > > Lingerfelt"
> > > > <scott.lingerfelt@> wrote:
> > > > >
> > > > > Hi Jono,
> > > > >
> > > > > This does help thanks for sharing!
> > > > >
> > > > > Scott
> > > > >
> > > > > On 7/17/08, Jono Woodhouse <justcool_foxyahoo@> wrote:
> > > > > >
> > > > > > Hi Scott
> > > > > >
> > > > > > We've tried a number of different ways of calling system
> > commands, and
> > > > > > found that when using sqlite3 (via PHP's PDO drivers) that
it was
> > > > tricky to
> > > > > > get right on the foxboard. In the end I used the following
> > > > function that
> > > > > > worked as long as it was called before any of the SQLite3
> > > > functions. Your
> > > > > > situation may be quite different though..... and hopefully
you can
> > > > use the
> > > > > > normal system commands without needing to use the
following.....
> > > > but here it
> > > > > > is for reference:
> > > > > >
> > > > > > <?php function systemcmd_ex($commandstr)
> > > > > > {
> > > > > > $pid = pcntl_fork();
> > > > > > if ($pid == -1) {
> > > > > > die('could not fork');
> > > > > > } else if ($pid) {
> > > > > > // we are the parent
> > > > > > pcntl_waitpid($pid, $status); //Protect against Zombie
> > > > children
> > > > > > return($status);
> > > > > > } else {
> > > > > > // we are the child
> > > > > > // Use pcnl_exec
> > > > > > $args = array ($commandstr);
> > > > > > pcntl_exec("/var/local/www/quiet.sh", $args);
> > > > > > exit(-1); // should never get here!!
> > > > > > }
> > > > > > }
> > > > > > ?>
> > > > > >
> > > > > > You'll also need to create a quiet.sh script (also with
chmod +x)
> > > > - you may
> > > > > > want it in another location - just remember to change the
> > > > reference to it's
> > > > > > path above too.
> > > > > > which has the following 2 lines in it (remember to use
UNIX (and
> > > > not DOS)
> > > > > > encoding for this file):
> > > > > > #!/bin/sh
> > > > > > $@ > /dev/null 2>&1
> > > > > >
> > > > > >
> > > > > > We are configuring php (v5.2.6) with the following options:
> > > > > > --disable-all \
> > > > > > --with-config-file-path=/etc/ \
> > > > > > --enable-pdo \
> > > > > > --enable-session \
> > > > > > --with-pdo-sqlite \
> > > > > > --enable-posix \
> > > > > > --enable-pcntl \
> > > > > > --enable-discard-path
> > > > > >
> > > > > >
> > > > > > Cheers
> > > > > > Jono
> > > > > >
> > > > > > Scott Lingerfelt wrote:
> > > > > >
> > > > > > I have been successfull sending arguments to a shell script
> > from a php
> > > > > > web page but cannot get them to be passed to the system.
> > > > > >
> > > > > > How can I have an interface in php and have the user set the
> > date and
> > > > > > submit allowing it to update the system date and time?
> > > > > >
> > > > > > Here is a simple php test page:
> > > > > > [code]
> > > > > > <?php
> > > > > > $cmd=070600002008.00 //test date/time
> > > > > >
> > > > > > $output = shell_exec('/mnt/flash/date_set.sh '.$cmd);
> > > > > > echo "<pre>$output</pre>";
> > > > > > ?>
> > > > > > [/code]
> > > > > >
> > > > > > and here is the script date_set.sh:
> > > > > > [code]
> > > > > > var1=$1
> > > > > > echo 'date ' . $var1
> > > > > > [/code]
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > > Scott
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> > 
> >
>


Reply via email to