php exec()
| From: | cheesiong | Date: | Mon, 03 Nov 2008 03:31:03 +0000 |
| Subject: | php exec() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-282765@lists.php.net to get a copy of this message | ||
hi all,
this is the first time i try out the mailing list. i hope to get help from
here. thank you.
i hope this email can reach the mail group as i use bluecolour.sz to sign on
the news group but using bluecolour to do all the emailing.
i am facing a problem when i study exec() php function:
i tried the example 1 on http://cn.php.net/manual/en/function.exec.php
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>
this is alright for me.
when i added a line to the script
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
echo exec('/program/ipkg-0.99.163/bin/ipkg-cl --version');
[echo exec('ifconfig');]
?>
the output from the browser is the same and not the expecting version of the
ipkg-cl.
then i tried to echo exec('ifconfig'); the output is the same also.
below is the output of server error log.
root [ /srv/www/test ]# !tail
tail /program/httpd-2.2.9/logs/error_log
[Mon Nov 03 11:25:14 2008] [error] [client 10.104.9.220] ipkg version
0.99.163
-------------------------
ipkg-cl is executable. is chmod 777.
root [ /srv/www/test ]# file /program/ipkg-0.99.163/bin/ipkg-cl
/program/ipkg-0.99.163/bin/ipkg-cl: ELF 32-bit LSB executable, Intel 80386,
version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared
libs), not stripped
i have tried to read more on the php net and have a few different trials. i
do not have more idea now, i hope i can get someone help from here.
thank you.
regards,-keo