Negin Nickparsa <> hat am 17. Februar 2012 um 12:26

> 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 not fail but prints nothing, the
output is empty.
By simply checking

if (system(...))

you will get echo 'Error'; even if everything is fine, but nothing is
print. Try checking on FALSE

if (($out = system(...)) !== FALSE)
  print('Not error');
  printf('Output is "%s"', $out);

Besides: I would prefer setting the complete path to your exe-file.

if (system('C:\\PATH\\TO\\MY\\gams.exe trnsport_php.gms'))

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to