Re: How to Execute Exe File from PHP
| From: | Stut | Date: | Mon, 20 Oct 2008 20:51:23 +0000 |
| Subject: | Re: How to Execute Exe File from PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282150@lists.php.net to get a copy of this message | ||
On 20 Oct 2008, at 21:47, Alice Wei wrote:
Has anyone tried to execute an .exe file from PHP? I am currently stuck in a situation where I cannot execute the script, and all I am getting is a blank screen. This is my code snippet used to execute the file: //execute program $a = @shell_exec("C:\Inetpub\wwwroot\test/test.exe"); echo $a; The program above is supposed to generate a file, so I can read from it. I have previously set up a file, and I have no problems with reading the file. Can anyone please help me with the possible command to execute the script? I tried CURL too, but it does not seem to be working either.1) Remove the @ before the function call, it's hiding the error message! 2) \ needs to be escaped within double quotes, try replacing each one with \\ 3) Why are you mixing \'s and /'s? Dunno whether it matters, but it's definitely better to stick to one or the other. 4) There is no 4! -Stut -- http://stut.net/