PHP to execute an executable EXE program, please help AH
Source: Internet
Author: User
PHP to execute an executable EXE program, urgent URGENT!!!! Ask for prawn to help ah ...
Under Apache server, how to execute an executable EXE program in PHP language?
For example, there is an executable file Aaa.exe, you double-click on the execution, but now just do not want you to double-click,
Instead, let the Aaa.exe execute in a PHP program. When accessing the address of this PHP file in IE, it is equivalent to double-clicking the Aaa.exe program.
For example C:\windows\system32\ This directory has a lot of EXE files.
With a notepad.exe, executing a PHP file is equivalent to opening a new Notepad window.
I found it online, let's use exec (' notepad.exe '); I've tried, I don't know why I didn't do it ....
There are a lot of people who say permissions, but they don't say how the permissions are set ...
Hope prawn help, solve this problem ... Thanks, man. Happy new year!
------Solution--------------------
Pure PHP can also write, I have seen the pure PHP written interface, is ugly point. exec should be able to.
------Solution--------------------
Explore
Under Apache server, how to execute an executable EXE program in PHP language?
For example, there is an executable file Aaa.exe, you double-click on the execution, but now just do not want you to double-click,
Instead, let the Aaa.exe execute in a PHP program. When accessing the address of this PHP file in IE, it is equivalent to double-clicking the Aaa.exe program.
For example C:\windows\system32\ This directory has a lot of EXE files.
There is a notepad.exe, execute a PHP ...
------Solution--------------------
Pure PHP can execute some exe. I only tried under win, such as net User,dir. And the GUI interface should not be executed. Of course, if the client is win, Is it better to execute a program with a call to win with JavaScript or something like this, so that you can execute a GUI interface with Wscript.exe?
Pure PHP performs EXE functions normally I use EXEC () or system (). Function prototypes given in the function manual
String exec (String command, string [array], int [return_var]);
String escapeshellcmd (String command);
String System (String command, int [Return_var]);
Specific instructions LZ or go down the function manual well, I generally use:
$result =system (Escapeshellcmd ($commands));
Print "
Execution result ". $result;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.