Re: Using Exec Function

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

 



Exec is the way to go... it gives you output as well as any error status. Here's an example script that works for a Win32 program I have and you should be able to adapt to your own usage:

<?php
/** Notice that the command has extra quotes around it for the Windows command line as well as double-backslashes for each directory in the path */
	$win_cmd = "\"C:\\Program Files\\The Regex Coach\\The Regex Coach.exe\"";
	exec($win_cmd, $stdout, $stderr);
	print "Standard output:\n";
	print_r($stdout);
	print "Standard error:\n";
	print_r($stderr);
	
?>

--
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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