title: Running oowriter headless command using php exec() not executing
body: <p>I'm having issues using oowriter to convert a doc to a pdf using php <code>exec()</code>. The line i'm running below works fine in CLI, just not in php using exec().</p>
  
  <pre><code>$stdin = "/usr/bin/oowriter --headless --convert-to pdf -outdir /var/data/uploads/ /var/data/uploads/lorem.docx";
  
  exec($stdin,$stdout,$return_int);
  </code></pre>
  
  <p><code>$stdout</code> returns an empty <code>Array</code> and <code>$return_int</code> returns <code>0</code>.</p>
  
  <p>I've searched around and the only possible solution I could find was adding the path to oowriter (which you can see i have done). Is there a permissions issue running this command as the apache user? There are a few posts on exec() not working in general, but I can successfully run commands for imagemagick using this method. Therefore it seems to me that this an application specific configuration issue with openoffice. </p>
  
  <p>Appears to be a duplicate of the following, but no answers have been posted:</p>
  
  <p><a href="https://stackoverflow.com/questions/10169042/unable-to-run-oowriter-as-web-user">unable to run oowriter as web user</a> </p>
  
  <p>FYI I'm using CentOS V6.1 and PHP v5.3.3. Thanks.</p>