Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 命令在cmd中工作,但在shell_exec()中不工作_Php_Shell_Cmd - Fatal编程技术网

Php 命令在cmd中工作,但在shell_exec()中不工作

Php 命令在cmd中工作,但在shell_exec()中不工作,php,shell,cmd,Php,Shell,Cmd,我正在使用WAMP上的shell_exec打印pdf,我的代码是 echo '"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe" /t c:\\bill.pdf'.'<br>'; shell_exec('"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe" /t c:\\bill.pdf'); 这意味着shell_exec正在工作,但pr

我正在使用WAMP上的shell_exec打印pdf,我的代码是

echo '"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe" 
/t c:\\bill.pdf'.'<br>';
shell_exec('"C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe" 
/t c:\\bill.pdf');
这意味着shell_exec正在工作,但print命令不工作。
我如何使用shell_exec执行print命令?

可能是因为apache运行的用户与您不同?可能是它的机器位问题,请尝试以下答案@很高兴您能够解决此问题?很遗憾,编号:
Sends a print job to a network printer Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d] filename Options: -S server Name or ipaddress of the host providing lpd service -P printer Name of the print queue -C class Job classification for use on the burst page -J job Job name to print on the burst page -o option Indicates type of the file (by default assumes a text file) Use "-o l" for binary (e.g. postscript) files -x Compatibility with SunOS 4.1.x and prior -d Send data file first