简体   繁体   English

在PHP中运行exec函数

[英]Run exec function in PHP

I am using exec function to run a bat file and change the default printer. 我正在使用exec函数运行bat文件并更改默认打印机。 exec file is doing fine, bat file alone is doing fine, but the printer doesn't change when I'm calling the bat file via exec function. exec文件运行良好,仅bat文件运行良好,但是当我通过exec函数调用bat文件时,打印机没有更改。 I put "echo 1" in the bat file. 我在蝙蝠文件中放入了“ echo 1”。 Browser showed "1" but my printer didn't change. 浏览器显示“ 1”,但我的打印机没有变化。 I really need a miracle to solve this !! 我真的需要奇迹来解决这个问题! my OS is Microsoft Server 2003. any ideas? 我的操作系统是Microsoft Server2003。有什么想法吗?

Sounds like a permissions issue. 听起来像是权限问题。 The user your web server is running as can run the batch file, but the batch file doesn't have permissions to change the printer (and is failing quietly). 您的Web服务器正在运行的用户可以运行该批处理文件,但是该批处理文件没有更改打印机的权限(并且正在静默失败)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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