Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I <3 myself sooo Much :) It works now like a charm I am successfully finished:D this is my SIMPLE solution no need to set path files! :D echo exec('C:\WINDOWS\system32\cmd.exe'); echo exec('gams.exe trnsport_php.gms'); It works like a charm:) On Fri, Feb 17, 2012 at 6:34 PM, Negin Nickparsa wr

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I found the correct one: $cmd = 'C:\Progra~1\GAMS23.7\gams.exe'.' '.escapeshellarg('C:\Progra~1\GAMS23.7\trnsport_php.gms').' 2>&1'; $out = `$cmd`; var_dump($out); It will show NULL,so No error and I am sure it is correct because If I change gams.exe to egams.exe it recognizes but It can't run th

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
:) On Fri, Feb 17, 2012 at 5:27 PM, Fatih P. wrote: > well then fix it. i m not using editor. >

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
well then fix it. i m not using editor.

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
it's wrong Fatih because it shows me another color in editor On Fri, Feb 17, 2012 at 5:24 PM, Negin Nickparsa wrote: > Fatih what is about another parts? >

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Fatih what is about another parts?

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
On Fri, Feb 17, 2012 at 3:43 PM, Negin Nickparsa wrote: > Fatih C:\Program Files\GAMS23.7 this is where my Gams is. > maybe the problem is with permissions > what should I do for permissions? > what shoud I do to write this path file:'( > I need it! > when echo system('dir') > shows me files of C:

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Fatih C:\Program Files\GAMS23.7 this is where my Gams is. maybe the problem is with permissions what should I do for permissions? what shoud I do to write this path file:'( I need it! when echo system('dir') shows me files of C:\Program Files\GAMS23.7 then it shoud run the command gams.exe transpor

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct? means false.. it cannot find the path. you have problem with path.

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Curtis I wrote this one as you said: if(system("C:\/Program\ Files\\GAMS23.7\\gams.exe \"C:\/Program\ Files\GAMS23.7\trnsport_php.gms")) echo 'No Error'; else echo 'Error'; how to set the path file correct?I really need it Does anyone has a good reference showing me how to write path files in php

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
curtis what do you mean --c? On Fri, Feb 17, 2012 at 4:54 PM, Curtis Maurand wrote: > > "C:\/Program\ Files\\..." > > --C > > > Negin Nickparsa wrote: > > I can't move Gams because it has many dll files which should be in there. > > gams.exe should be execute in that path file in program Files >

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Curtis Maurand
"C:\/Program\ Files\\..." --C Negin Nickparsa wrote: > I can't move Gams because it has many dll files which should be in there. > gams.exe should be execute in that path file in program Files > one time I tried to do it and when It shows me missing files I copy pasted > many files but It need

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
$cmd = system ("\"C:\\Program Files\\GAMS23.7\\gams.exe\" trnsport_php.gms"); $out = `$cmd`; var_dump($out); It shows NULL On Fri, Feb 17, 2012 at 4:38 PM, Negin Nickparsa wrote: > and this One > system ("\"c:\\program files\\myapp\\myapp.exe\" params_for_myapp"); > > > On Fri, Feb 17, 2012 at 4

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
and this One system ("\"c:\\program files\\myapp\\myapp.exe\" params_for_myapp"); On Fri, Feb 17, 2012 at 4:36 PM, Negin Nickparsa wrote: > I read about > > The useless command may be like "c:" or "cd". > > Example: > > system('c: & "C:\Program Files\..." "parameter 1" "parameter 2"'); > > exec('

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I read about The useless command may be like "c:" or "cd". Example: system('c: & "C:\Program Files\..." "parameter 1" "parameter 2"'); exec('c: & "C:\Program Files\..." "parameter 1" "parameter 2"'); in php manual But I didn't know how to work with it It doesn't use any back slashes On Fri, Fe

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I trie

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Stuart Dallas
On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: > this one: > $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program > Files/GAMS23.7/trnsport_php.gms').' 2>&1'; > > GENERATES: > > string(100) "'C:/Program\' is not recognized as an internal or external > command, operable

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 2>&1'; GENERATES: string(100) "'C:/Program\' is not recognized as an internal or external command, operable program or batch file. " Change the \\ in the commands to just a s

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Stuart Dallas
On 17 Feb 2012, at 12:42, Negin Nickparsa wrote: > Oops no! it shows this one: > string(100) "'C:/Program\' is not recognized as an internal or external > command, operable program or batch file. " Change the \\ in the commands to just a single \ but leave the space after it. > On Fri, Feb 17,

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Stuart I changed it to this one:$cmd = 'C:/Program\\Files/ Now it tells: string(43) "The system cannot find the path specified. " On Fri, Feb 17, 2012 at 4:12 PM, Negin Nickparsa wrote: > Oops no! it shows this one: > string(100) "'C:/Program\' is not recognized as an internal or external > c

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Oops no! it shows this one: string(100) "'C:/Program\' is not recognized as an internal or external command, operable program or batch file. " On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa wrote: > ok sorry,I tried yours It generates Null. > > > On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas wrote: > Please quote the relevant parts of the email you're replying to - your > emails have massively diminished usefulness to the archives. > > On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: > > It gene

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Stuart Dallas
Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: > It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Progr

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
ow! Thanks I got Stuart meaning Now

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Fatih it shows this: ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct?

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Vikash Kumar
backtick operator ( http://www.php.net/manual/en/language.operators.execution.php) works like shell_exec() On 17 February 2012 18:00, Negin Nickparsa wrote: > stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it >

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Duken how you use " and again another " without a dot? I tried yours it says: *Warning*: system() [function.system ]: Cannot execute a blank command in *C:\Program Files\GAMS23.7\calling_gams.php* on line *23* Error

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Duken Marga
I think it's wrong: system(' "C:/Program Files/GAMS23.7/gams.exe "C:/Program Files/GAMS23.7/trnsport_php.gms')) Instead, try this: system(' "C:/Program Files/GAMS23.7/gams.exe" "C:/Program Files/GAMS23.7/trnsport_php.gms" ')) It is a good practice to write full path because we don't know behaviou

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
Apache

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
On Fri, Feb 17, 2012 at 2:19 PM, Stuart Dallas wrote: > On 17 Feb 2012, at 12:12, Negin Nickparsa wrote: > > if (($out = system(' "C:/Program Files/GAMS23.7/gams.exe "C:/Program > > Files/GAMS23.7/trnsport_php.gms')) !== FALSE) > > { > > print('Not error!'); > > printf('Output is "%s"', $out); >

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I changed it to this one: $out = $cmd; now it shows string(85) "C:/Program Files/GAMS23.7/gams.exe "C:/Program Files/GAMS23.7/trnsport_php.gms" 2>&1"

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
It generates NULL

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Stuart Dallas
On 17 Feb 2012, at 12:12, Negin Nickparsa wrote: > if (($out = system(' "C:/Program Files/GAMS23.7/gams.exe "C:/Program > Files/GAMS23.7/trnsport_php.gms')) !== FALSE) > { > print('Not error!'); > printf('Output is "%s"', $out); > } > else > { > print('Error'); > } > Fatih it shows again nothing wh

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
if (($out = system(' "C:/Program Files/GAMS23.7/gams.exe "C:/Program Files/GAMS23.7/trnsport_php.gms')) !== FALSE) { print('Not error!'); printf('Output is "%s"', $out); } else { print('Error'); } Fatih it shows again nothing why I should set the full path even when I run my file on the path I d

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
replace \ in path with / then should work fine on windows too.

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Duken Marga
Try to write full path to executable file and don't forget to bring double quote to that path. It must because "Program files" contain space and php think your program is "Program" that contain parameter "files". if(system(' "C:\Program Files\GAMS23.7\gams.exe" trnsport_php.gms') On Fri, Feb

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I don't know what is going here!? well it shows no error but the out put is nothing and my gams when running should make a text file but by running,it doesn't happen so It has problem

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
give the full path of trnsport_php.gms too. shell_exec should be working fine on windows as well.

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
yes it prints nothing by this code if (($out = system('C:\Program Files\GAMS23.7\gams.exe trnsport_php.gms')) !== FALSE) { print('Not error'); printf('Output is "%s"', $out); } else { print('Error'); }

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread ma...@behnke.biz
Negin Nickparsa hat am 17. Februar 2012 um 12:26 geschrieben: > if(system('gams.exe trnsport_php.gms')) > echo 'Not Error'; > else echo'Error'; > > it shows me Error system() Returns the last line of the command output on success, and FALSE on failure. So, lets assume your gams program does n

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Negin Nickparsa
I am in windows yeah I tried this one if(shell_exec('C:\Program Files\GAMS23.7\gams.exe trnsport_php.gms')) echo 'yes' ; else echo 'no'; it wil show me no my another try: if(shell_exec('cd C:\Program Files\GAMS23.7') ) echo 'yes'; else echo 'no'; it will show me No aga

Re: [PHP] how to execute Exe file in system

2012-02-17 Thread Fatih P.
On Fri, Feb 17, 2012 at 1:26 PM, Negin Nickparsa 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 g