title: Problem with exec(), specifically in Drupal
body: <p>I'm trying to make a module in Drupal which utilizes exec(). The script runs fine if I load it manually in the browser or when I run it as su -l www-data, but when run by Drupal as a module the exec function doesn't run. I'm wondering how I can get more data out of this to better debug, or if anyone might know why Drupal won't let the exec run. </p>
  
  <p>When loaded by Drupal, the entire script does execute without giving me any warnings or errors, which I find weird. If I add an <code>or die('could not exec');</code> after the exec(), when I load my drupal page it does show me just "could not exec" and nothing else.</p>
  
  <p>Any ideas? Thanks!</p>
  
  <p>[EDIT]</p>
  
  <p>I got this to working by specifying the explicit path of the php file I'm trying to exec. That is, I changed:
  <code>exec('php mymodule.helper',$output);</code></p>
  
  <p>to </p>
  
  <p><code>exec('php /var/www/mydrupal/modules/mymodule/mymodule.helper',$output);</code></p>
  
  <p>[EDIT2]<br>
  Actually, I changed it now to:<br>
  <code>exec ('php ' . __DIR__ . '/mymodule.helper',$output);</code></p>
  
  <p>Which works perfectly. </p>