title: WkHTMLtoPDF 0.12.2.1 PHP exec xvfb-run: Error: xauth command not found
body: <p>I want to generate a PDF from a URL, so I execute the command by WkHTMLtoPDF as below:</p>
  
  <pre><code>/usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/local/bin/wkhtmltopdf http://www.google.com /tmp/google.pdf  2&gt;&amp;1
  </code></pre>
  
  <p>The above command works fine on Terminal, But when I invoke the command inside PHP failed! And show me an error message as below:</p>
  
  <pre><code>array(2) { 
      [0]=&gt; string(27) "which: no xauth in ((null))"
      [1]=&gt; string(40) "xvfb-run: error: xauth command not found"
  }
  </code></pre>
  
  <p>I don't know how to resolve this issue! Anyone can help me on this, my OS environment as below:</p>
  
  <ul>
  <li>OS: CentOS release 6.6</li>
  <li>wkhtmltopdf version: 0.12.2.1</li>
  <li>nginx version: nginx/1.6.3</li>
  </ul>
  
  <p>My PHP code as below:</p>
  
  <pre><code>&lt;php
      $var = array();
      $res = 0;
  
      $cmd = '/usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/local/bin/wkhtmltopdf http://www.google.com /tmp/google.pdf  2&gt;&amp;1';
  
      exec($cmd, $var, $res);
  
      echo $cmd.'&amp;lt;br /&amp;gt;';
      var_dump ($var);
  ?&gt;
  </code></pre>