You are here: popen won't work for me « PHP Programming Language « IT news, forums, messages
popen won't work for me

Posted by M on 07/08/05 21:49

Hi Folks,

I would like to use popen and redirect output from a program, except it
doesn't seem to work. I am using IIS 5.1 on Windows XP Pro.

Error messages are as follows:

Warning: popen(C:\Test\runcmd.bat Output.exe,r) [function.popen]: No such
file or directory in c:\Inetpub\wwwroot\Php\POpenTest.php on line 15

Warning: pclose(): supplied argument is not a valid stream resource in
c:\Inetpub\wwwroot\Php\POpenTest.php on line 16

Test Code so far is as follows:

define('RUNCMDPATH', 'C:\\Test\\runcmd.bat');

function runCmd($cmd) {
$externalProcess=popen(RUNCMDPATH.' '.$cmd, 'r');
pclose($externalProcess);
}

runCmd('Output.exe');


Any ideas why I get this error message?

Regards,

Martin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация