On Fri, Feb 17, 2012 at 1:26 PM, Negin Nickparsa nickpa...@gmail.comwrote:
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
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
Negin Nickparsa nickpa...@gmail.com 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
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');
}
give the full path of trnsport_php.gms too.
shell_exec should be working fine on windows as well.
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
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 17,
replace \ in path with /
then should work fine on windows too.
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
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 why I should set
It generates NULL
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 21
On Fri, Feb 17, 2012 at 2:19 PM, Stuart Dallas stu...@3ft9.com 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);
Apache
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
behaviour any
Duken how you use and again another without a dot?
I tried yours it says:
*Warning*: system() [function.system http://localhost/gams/function.system]:
Cannot execute a blank command in *C:\Program
Files\GAMS23.7\calling_gams.php* on line *23*
Error
stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it
backtick operator (
http://www.php.net/manual/en/language.operators.execution.php) works like
shell_exec()
On 17 February 2012 18:00, Negin Nickparsa nickpa...@gmail.com wrote:
stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it
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?
ow! Thanks I got Stuart meaning Now
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'.'
ok sorry,I tried yours It generates Null.
On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com 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:
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 nickpa...@gmail.comwrote:
ok sorry,I tried yours It generates Null.
On Fri, Feb 17, 2012 at 4:06 PM,
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 nickpa...@gmail.comwrote:
Oops no! it shows this one:
string(100) 'C:/Program\' is not recognized as an internal
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, 2012
this one:
$cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program
Files/GAMS23.7/trnsport_php.gms').' 21';
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
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').' 21';
GENERATES:
string(100) 'C:/Program\' is not recognized as an internal or external
command, operable program
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
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, Feb 17, 2012 at
and this One
system (\c:\\program files\\myapp\\myapp.exe\ params_for_myapp);
On Fri, Feb 17, 2012 at 4:36 PM, Negin Nickparsa nickpa...@gmail.comwrote:
I read about
The useless command may be like c: or cd.
Example:
system('c: C:\Program Files\... parameter 1 parameter 2');
exec('c:
$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 nickpa...@gmail.comwrote:
and this One
system (\c:\\program files\\myapp\\myapp.exe\ params_for_myapp);
On Fri, Feb 17,
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 needs
curtis what do you mean --c?
On Fri, Feb 17, 2012 at 4:54 PM, Curtis Maurand cur...@maurand.com 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
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
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.
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
On Fri, Feb 17, 2012 at 3:43 PM, Negin Nickparsa nickpa...@gmail.comwrote:
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
Fatih what is about another parts?
it's wrong Fatih because it shows me another color in editor
On Fri, Feb 17, 2012 at 5:24 PM, Negin Nickparsa nickpa...@gmail.comwrote:
Fatih what is about another parts?
well then fix it. i m not using editor.
:)
On Fri, Feb 17, 2012 at 5:27 PM, Fatih P. fatihpirist...@gmail.com wrote:
well then fix it. i m not using editor.
I found the correct one:
$cmd = 'C:\Progra~1\GAMS23.7\gams.exe'.'
'.escapeshellarg('C:\Progra~1\GAMS23.7\trnsport_php.gms').' 21';
$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
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
43 matches
Mail list logo