2012-02-14 57 views
0

我想执行一个application这是在gams中的php我在下面插入路径文件位置 它显示错误,我该如何纠正它?系统功能不起作用

$modelfile = 'trnsport_php.gms'; 
if (!system('C:/Documents and Settings/Parsa/My Documents/gamsdir/projdir'.$modelfile.' lo=2')) { 
    print "error"; 
} 
+0

看起来你使用的是Windows系统。不应该\是\? – codaddict 2012-02-14 08:49:46

+0

是的,我试过\但没有结果 – Nickool 2012-02-14 08:51:29

回答

1

您应该添加一个 “/” 后

!system('C:/Documents and Settings/Parsa/My Documents/gamsdir/projdir 
+0

这是否工作? – 2012-02-14 15:03:12

+0

谢谢不,它不工作我发现了新的东西我在一个很大的错误,它就像在shell中运行,所以我问这一个http://stackoverflow.com/questions/9326633/execute-exe-file-from-an -application-with-system – Nickool 2012-02-17 10:38:58

+0

您可能想要使用“if system(...)=== FALSE”,因为它在出错时输出布尔值FALSE。 !(系统(...))在系统返回空行或“0”时也可能评估为真。 – 2012-02-17 11:48:24