开发者

executing a Windows command line program with system call in PHP

开发者 https://www.devze.com 2023-02-15 05:23 出处:网络
I am trying to execute a program using a system call inside a php file like so: $newname = \'C:\\Users\\Jack\\Desktop\\upload\\test.ppt\' ;

I am trying to execute a program using a system call inside a php file like so:

$newname = 'C:\Users\Jack\Desktop\upload\test.ppt' ;
$program = '"C:\Program Files (x86)\Softinterface, Inc\Convert PowerPoint\ConvertPPT"';
$input = ' /S "'. $newname .'"' 
$destination = ' /T "C:\Users\Jack\Desktop\upload\\"';
$switch = ' /C 18';
$command = $program . $input . $destination . $switch;
system($command);

For some reason, the program enters an infinite loop (the browser never stops loading). I have tried the command manually and it works perfectly (tak开发者_如何学Pythones about 2 sec to complete) but when executing it with a php file doesn't work.


use the backtick(`) symbol to wrap around the command you want to run.

0

精彩评论

暂无评论...
验证码 换一张
取 消