简体   繁体   中英

executing a Windows command line program with system call in PHP

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 (takes about 2 sec to complete) but when executing it with a php file doesn't work.

使用backtick(`)符号来包装要运行的命令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM