Why does calling drush command by system() fail?

冷暖自知 提交于 2019-12-24 20:47:25

问题


I have Drupal 7 site on IIS 7.5 server.

Inside IIS Services Manager I choose user with administrator rights in anonymous authentication settings.

I'm sure that drush command is in evn path. When I logged as this user (Win7) I can call this command everywhere.

However when I try to launch this command inside Drupal module:

  $output = array();
  $res = exec('drush --version', $output, $retval);

$retval is always 1 (error), $output and $res are empty.

Different command (sqlcmd) works ok. Both commands has identical rights (file system)

What I am doing wrong here?

Using absolute paths solves my issue, but only for paths without spaces.

来源:https://stackoverflow.com/questions/16628831/why-does-calling-drush-command-by-system-fail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!