RE: [PHP] How to Execute Exe File from PHP

From: Date: Wed, 22 Oct 2008 09:49:22 +0000
Subject: RE: [PHP] How to Execute Exe File from PHP
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-282240@lists.php.net to get a copy of this message
On 22 Oct 2008 at 2:14, Alice Wei wrote: > > HI, > > To answer your questions, I run this on Windows. What is so weird is > that when I do > > $a= shell_exec("C:\Inetpub\wwwroot\/test.exe -m$market -d$length"); echo > $a; > > It works, and echoes everything as it is supposed to, and the file is also > generated like I expected. However, the PHP file where I execute this from > is in the same folder (which is why I thought using a . would work) > > Could anyone please tell me if this is only way Ito do this on a Windows > machine? > > Thanks in advance, I think I am getting a little confused. Hi, It may help to run the command 'dir' to see where the web server considers its path to be: <? $a= shell_exec("dir"); echo $a; ?> The response will include the current path as well as a directory listing. Regards Ian --

« previous php.general (#282240) next »