PHP: shell_exec Permissions on Windows Server


PHP: shell_exec Permissions on Windows Server

我有以下问题:如果我通过Shell (cmd.exe)在我的Windows Server 2012上执行Shell参数,它执行完美。但是如果我通过PHP (shell_exec)做同样的事情,它执行,但没有访问模板文件。

aerender ERROR:没有找到给定名称的渲染设置模板。

代码

PHP:

<?php
chdir('C:''Program Files''Adobe''Adobe After Effects CC 2015''Support Files''');
shell_exec('aerender -project C:'server'htdocs'ae'final3'final.aep 
-comp "clouds-   rotation-low" -RStemplate "E2Z640blur" 
-OMtemplate "E2Z640" -output C:'server'htdocs'cache'clouds-rotation-low.avi')  
?>

是的,这是因为当PHP打开cmd时它不会按标准加载PATH变量,我认为有一种方法可以解决这个问题,或者你可以为ender使用绝对路径ie。C:'aerender'aerender

好了,现在它工作了!我刚刚更改了Windows中的apache2服务,以管理员身份运行