RE: How to Execute Exe File from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-- 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux