Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- call perl script from within a php script
August 30, 2010, 8:45 pm
rate this thread
I want to call a perl script from within a php script. I have tried
system() and exec() commands but i'm never getting any output. The
script works fine on the shell tho... :(
What I've tried:
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
//$last_line = system('ls -la'/*'./TSPtest.pl'*/, $retval);
$last_line = exec(TSPtest.pl, $retval);
echo "len: " . strlen($last_line) . "<BR>";
// Printing additional info
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
$output = shell_exec("./TSPtest.pl");
But I don't get anything back... why not? What am i missing? :o
Thanks for help!!!