0

i'm trying to execute a program from my php. I want to execute it and pass it a variable, i've tried using exec($cmd, $op) but the array of $op doesn't have the output within it (or anything else).

Should i be using a different function to get this working? any help would be much appreciated.

n.b. safe mode is de-activated.

2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by EvilOrange
0

This is the code i'm now using still not producing any results.

[INDENT]
<?php

$cmd = "./programs/x /images/y.jpg";
unset($op);

$op = shell_exec($cmd);
//echo $cmd;
//echo "there should be something here";
echo($op);

?>
[/INDENT]
0

What is the expected output? Also, go to where the script is and execute that command by hand, what do you get?

0

the exec() command was giving me only the last line of the expected output for some reason.

but it was a very simple change that made the shell_exec work, was as easy as changing the "/image/..." to "./image/..."

thanks for the help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.