给CMD添加internet账户权限

WBOY
Release: 2016-06-06 20:52:32
Original
1031 people have browsed it

想用php来执行外部程序,现在在浏览器方式执行的话无效,查了一下说是要给cmd.exe添加internet权限,怎么添加呢?

问题修改一:
index.php

$dir = 'E:\test';

$output=array();
$command = "svn update ".$dir;

//print_r($command);
exec($command,$output);
for ($i=0;$i 

在windows下部署,然后浏览器里执行,无效

问题修改二:
进一步测试,发现如果全是在本机的话(本机访问)没有问题,但如果我在其它电脑上访问这台电脑上的这个页面就无效了!

回复内容:

想用php来执行外部程序,现在在浏览器方式执行的话无效,查了一下说是要给cmd.exe添加internet权限,怎么添加呢?

问题修改一:
index.php

$dir = 'E:\test';

$output=array();
$command = "svn update ".$dir;

//print_r($command);
exec($command,$output);
for ($i=0;$i 

在windows下部署,然后浏览器里执行,无效

问题修改二:
进一步测试,发现如果全是在本机的话(本机访问)没有问题,但如果我在其它电脑上访问这台电脑上的这个页面就无效了!

您的意思是,用户访问服务器上的页面,实现在服务器端执行cmd的目的是把?

如果是这样的话,你确实需要给cmd.exe添加可执行权限。

首先你要确定你的apache跑在什么用户下,这里先假设你的apache是由apacherunner这个用户启动的。

你要在系统盘Windows\System32目录下找到cmd.exe 右键点击--》属性--》安全--》编辑--》添加 输入apacherunner --》确定;

在用户列表中选择刚刚添加的apache的启动用户,在下边的权限框里找到“读取和执行”在允许前打勾并确定。这样权限就加好了。

警告:您这样的做法会带来服务器的安全隐患,请不要在生产环境内使用这种方法。如需远程控制服务器请使用远程桌面等专业接口。

Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!