Re: php exec()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi Chris,
thank you.
it is not working as well.
i copy the ipkg-cl into /usr/bin

do i need to set anything in the httpd.conf on the <Directory> directive?
i am running apache-2.2.9.

this is code copy from you suggestion:
<?php
$output = array();
exec('ipkg-cl --version', $output);

print_r($output);
?>

output from browser:
Array ( )

output from prompt if i execute on the linux system:
root [ /srv/www/test ]# ipkg-cl --version
ipkg version 0.99.163


server error log:
root [ /srv/www/test ]# tail /program/httpd-2.2.9/logs/error_log

regards,-keo

[Mon Nov 03 12:50:00 2008] [error] [client 10.104.9.220] ipkg version
0.99.163

On Mon, Nov 3, 2008 at 12:33 PM, Chris <dmagick@xxxxxxxxx> wrote:

>
>  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.
>>
>
> You need to do this:
>
> $output = array();
> exec('/program/....', $output);
>
> for it to put the results of running the command into the $output array.
>
> Then you can print it:
>
> print_r($output);
>
>
> This is in the manual: http://au.php.net/manual/en/function.exec.php
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux