Disowned Posted May 11, 2009 Share Posted May 11, 2009 I want to know because I'm trying to build a web application that will take a video file from a user, convert that file to a another codec, and present the user with that converted file. I have a free .exe that does just that but I was wondering it was possible to get PHP to call that file? Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/ Share on other sites More sharing options...
DarkSuperHero Posted May 11, 2009 Share Posted May 11, 2009 is this on Windows Hosting or Linux Hosting? Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-831417 Share on other sites More sharing options...
RussellReal Posted May 11, 2009 Share Posted May 11, 2009 whatever the case maybe.. use exec Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-831421 Share on other sites More sharing options...
Disowned Posted May 11, 2009 Author Share Posted May 11, 2009 I think it's windows. Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-831422 Share on other sites More sharing options...
DarkSuperHero Posted May 14, 2009 Share Posted May 14, 2009 Would there be any difference in the way the exec(); function would be used on a windows machine? would it be a dos command ?? I've never used exec() and I was just curious... Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-834072 Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 ofcourse it can it can do anything , you can run loads of programs at the same time and communicate to different machines at the same time too Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-834075 Share on other sites More sharing options...
Disowned Posted May 14, 2009 Author Share Posted May 14, 2009 I noticed exec() doesn't allow you specify the path the .exe is in (like /root/app/exe.exe .) I saw another function called pcntl_exec() that does so but I have no real idea on how to use it. It says you have to have it located in !#/usr/bin/cgi, what exactly does that mean? Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-834312 Share on other sites More sharing options...
nadeemshafi9 Posted May 15, 2009 Share Posted May 15, 2009 $result = array(); $lastlineofresult = exec("ls", $result); // dir for windows print_r($result); //OR foreach($result as $alineofresult_key => $alineofresult_value){ echo $alineofresult_value; } Quote Link to comment https://forums.phpfreaks.com/topic/157664-can-php-call-a-external-exe/#findComment-834597 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.