Hello,
I'm trying to have my PHP script run an external program, a simple C program and get its output. Now, I can't get PHP to run anything so I didn't get around to the output part yet. I tried this code:
<?
$command="notepad.exe file.txt";
$result=passthru($command, $var);
echo $result;
echo "<br>";
echo $var;

exec($command, $result, $var);
?>
and it didn't work, I get a "connecting to site 127.0.0.1" message on the status bar that lasts for ever....(note that file.txt is in the same folder as the PHP file)
I tried a bunch of other functions (system(),shell_exec()...etc.) with different commands that work fine on my DOS command prompt but I still get the same problem, in some cases the page stops loading and I get the "done" message but nothing actually happens.

This is driving me crazy, I looked at a lot of help pages and tried some of the posted codes but they did work either… what am I doing wrong?

Any help will be greatly appreciated, thanks
PS: I'm running PHP 4.3.3 on windows XP home edition.

    hi,

    i am working on a dialog with a linux script, and had my share of problems with it.

    But for a one way communication i recommend popen function.
    The php-manual gives good examples for it.
    Come back if this doesnt help you.

      Write a Reply...