title: Unable to run inkscape in PHP shell_exec() command
body: <p>I have a <a href="http://www.designnbuy.com/all-in-one-designer-html5.html" rel="nofollow">design tool extension</a> that is used on a website I'm working on. The design tool uses <a href="https://inkscape.org/en/download/linux/" rel="nofollow">inkscape</a> command line to export images. There is a php interface to work with the command line operations which ultimately calls <code>shell_exec($inkscapeCmd)</code>. After noticing the image files weren't being exported, I created a few tests to try and debug. I changed the execute line to <code>shell_exec($inkscapeCmd . ' 2&gt;&amp;1')</code> in order to see the error message:</p>
  
  <p><code>sh: inkscape: command not found</code></p>
  
  <p>...which is odd since it's definitely installed and accessible. I added a check for the user on my test page to make sure the commands were being executed by a user with access to inkscape:</p>
  
  <p><code>$processUser = posix_getpwuid(posix_geteuid());
  echo 'user: ' . $processUser['name'];</code></p>
  
  <p>Then I ssh'd into the server to confirm that I could run the same commands as that user, and was able to run them without any issues (which also confirmed inkscape was in the PATH). I'm able to run other, basic shell commands from PHP without issue, like so:</p>
  
  <p><code>echo shell_exec('ls');</code></p>
  
  <p>But now I'm at a loss; I'm not sure what else to check to determine why I'm getting the 'command not found' error. Any direction would be helpful.</p>
  
  <p>The server (rather old, I know):</p>
  
  <ul>
  <li>CentOS 6.7 </li>
  <li>PHP 5.3.3 </li>
  <li>Inkscape v0.47</li>
  </ul>