【问题标题】:system function doesn't work系统功能不起作用
【发布时间】:2012-02-14 08:46:10
【问题描述】:

我想执行一个application,它是 php 中的 gams 我在下面插入路径文件位置 它显示错误我该如何纠正它?

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

【问题讨论】:

  • 看起来您使用的是 Windows 系统。 / 不应该是 \ 吗?
  • 是的,我也试过\但没有结果

标签: php path system


【解决方案1】:

你应该在

之后添加一个“/”
!system('C:/Documents and Settings/Parsa/My Documents/gamsdir/projdir

【讨论】:

  • 谢谢 不 没用 我发现新东西 我犯了一个大错误 就像在 shell 中运行 所以我问了这个stackoverflow.com/questions/9326633/…
  • 您可能想要使用“if system(...) === FALSE”,因为它会在错误时输出布尔值 FALSE。当系统返回空行或“0”时,!(system(...)) 也可能评估为 true。
猜你喜欢
  • 1970-01-01
  • 2020-07-13
  • 2023-03-08
  • 1970-01-01
  • 1970-01-01
  • 2021-03-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多