title: Executing wkhtmltopdf from PHP fails
body: <p>There have been a few topics similar to mine, but they did not help me. Maybe something new will come up.</p>
  
  <p>Problem: I can't execute wkhtmltopdf form PHP.
  My basic code is: 
  <code>exec('wkhtmltopdf http://somesite.com /home/user/file.pdf');</code></p>
  
  <p>Now a few things I already checked:</p>
  
  <ul>
  <li>the same command works when executed from console</li>
  <li>safe_mode is disabled - I can execute commands in PHP, for example <code>exec('ls');</code> works fine</li>
  <li>path to wkhtmltopdf can be found and I can run the program itself, for example <code>exec('wkhtmltopdf -V');</code> works fine and outputs versioning info</li>
  <li>the output path is writable, it has 777 permissions and <code>exec('wkhtmltopdf -V &gt; /home/user/file.pdf');</code> works fine, creates the file and puts versioning info inside</li>
  <li>executing from PHP has internet access, for exemple <code>exec('wget -O /home/user/file.pdf http://somesite.com')</code> works fine, retrieves the site source and puts it into the file</li>
  <li>replacing exec with passthru, shell_exec etc. makes no difference</li>
  </ul>
  
  <p>Concluding:
  I can execute wkhtmltopdf, I can access internet, I can write the specific file, but a correct conversion command fails and returns status 1.</p>
  
  <p>I use the latest Ubuntu, PHP Version is 5.3.10-1ubuntu3, wkhtmltopdf version is 0.9.9.
  I tried it also on some other machine with the same retults.</p>
  
  <p>Any (just ANY) ideas will be greatly appreciated!</p>