简体   繁体   English

exec不适用于Windows Server 2008 php

[英]exec doesn't work on window server 2008 php

i have a command below, if I run it through php file http://localhost/myfile.php 我在下面有一个命令,如果我通过php文件http://localhost/myfile.php运行它

it will output the cmd but input_file.txt is not generated. 它将输出cmd但不生成input_file.txt。

$cmd = "ffmpeg.exe -i C:\\ep-convert\\To_the_Beautiful_You_9.264 2> input_file.txt";
exec($cmd);
echo $cmd;

However if i copy the command output on the screen which is 但是,如果我复制屏幕上的命令输出是

ffmpeg.exe -i C:\ep-convert\To_the_Beautiful_You_9.264 2> input_file.txt

and i paste this in the console, its work. 我把它粘贴在控制台中,它的工作。

The issue is if i run other exe file like mencoder or mplayer etc. the output is shown, however just specifically this ffmpeg.exe seems to not running with my exec() 问题是如果我运行其他exe文件,如mencoder或mplayer等输出显示,但只是具体这个ffmpeg.exe似乎没有运行我的exec()

what could have gone wrong and how to get exec work with the cmd above. 什么可能出错,以及如何让exec使用上面的cmd。

I am running window server 2008 我正在运行Windows Server 2008

This is most likely a file permissions problem. 这很可能是文件权限问题。 You may run this command from console just because you are running console as administrator. 您可以从控制台运行此命令只是因为您以管理员身份运行控制台。 IIS has different user account. IIS具有不同的用户帐户。 Accessing other files are restricted by default. 默认情况下,访问其他文件受到限制。 You have to grant permission to that user for specific directories. 您必须为该用户授予特定目录的权限。 You can simply right click folder then click properties. 您只需右键单击文件夹,然后单击属性即可。 Go to the security tab and edit permissions. 转到安全选项卡并编辑权限。

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

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