简体   繁体   中英

php run exe throght exec in web but can't run gui

First I'm sorry for my English.. I want to run a command throught exec to open a program.

for example: I want to open a txt file D:\\text.txt test.php

exec('D:\text.txt');

I use cmd to run this php file, it can open text.txt. but when I run this php file in web server,it can't work. the file can't open but i find a process named notepad.exe in Task Manager. I tried a lot of method to resolve it but all ware failed.

My system: windows 7

php server : wampserver

user: Administrator

This web is only run in local.

Thanks very much.

Now I know how to resolve this problem. This code can open file on my work computer, but can't on myself computer. After I searched lots of, I fount it is related to os service. On my work computer, the xampp is copy from other computer, and apache runs without os service, after I install apache service, it also doesn't work.

So I think if I konw how to run apache without service, this problem will be resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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