PHP中,exec调用外部EXE文件中的命令,总是失败,求

WBOY
Release: 2016-06-13 12:59:54
Original
1484 people have browsed it

PHP中,exec调用外部EXE文件中的命令,总是失败,求高手指点
PHP中,exec调用外部EXE文件中的命令,总是失败,求高手指点
其中一个fossil.exe文件,文件路径已经添加到环境变量(或者指定exe文件路径)
在PHP中,通过
$c= "fossil clone -A admin http://admin:92dd3f@192.168.2.22:9090/cgi-bin/repo/95965728-994d-4d5d-9746-d84356f5b593 ".$localRepositoryPath;
 exec ( $c,$output,$status);

首先肯定的是,$c命令是没有问题的,因为在cmd命令行下面,是可以执行成功的!
但是执行的结果中,$status总是1(0表示成功)

但是我把$c="dir";则可以显示当前目录下的所有文件或目录
还有system方法,也试了,不行
pcntl_exec()方法竟然说是非unix系统下没有此方法,我晕菜啊!
求高手指点啊!
------解决方案--------------------
浏览器访问和终端下的访问是两个权限。浏览器中是普通用户权限,机子上装sudo(用户操作权限)
然后:exec ( "sudo ".$c,$output,$status);
------解决方案--------------------
参考:http://topic.csdn.net/u/20120619/12/b812046e-eeef-419b-9626-84d838615eb7.html
------解决方案--------------------
你的 fossil.exe 执行时是否需要用户参与?

------解决方案--------------------
调用了什么特殊功能?有些组件需要DCOM里授权。

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 admin@php.cn
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!