Re: how to execute Exe file in system

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

 



On Fri, Feb 17, 2012 at 1:26 PM, Negin Nickparsa <nickparsa@xxxxxxxxx>wrote:

> I have a Gams application<
> http://interfaces.gams-software.com/doku.php?id=env%3aspawning_gams_from_php
> >
>  which I want to run it through php code after trying many things finally I
> found that for running in commmand line I should go to C:\Program
> Files\GAMS23.7 run a command in commandline for running the application as
> follows:
>
> gams.exe trnsport_php.gms
>
> the Gams wil be run successfully in commandline now I wanted to run it in
> php I added an alias with this path
>
> C:\Program Files\GAMS23.7
>
> and then I created my php file in there when I want to exacute it with this
> code in php:
>
> if(system('gams.exe trnsport_php.gms'))
> echo 'Not Error';
> else echo'Error';
>
> it shows me Error
>
> and again using this one:
>
> if(system('./gams.exe trnsport_php.gms'))
> echo 'Not Error';
> else echo'Error';
>
> has printed again Error
>
> I tried exec too but no result I don't know what is wrong here.
>
> I read the manual but I coudn't find what's wrong here
>
> echo system('dir')
>
> will show the files of   C:\Program Files\GAMS23.7
>

have you tried using shell_exec with full path rather than including its
executation path?

$out = shell_exec('/var/www/myapp/run arg1 arg2');

[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