Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

file - How to run abc.exe using php

I want php file to run exe file and display the exe file content when user goes to a particular url. I am trying to run exe file using php function exec('abc.exe');. But I only see blank page.

Anyone know how to solve it or how to run exe file from php file correctly? Many thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To access the operating system with php you do the following

$answer = shell_exec("abc.exe");
echo $answer."</br>"; 

The $answer string will contain the information that the abc.exe prints out or returns.

You may need to format it using explode().


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...