Skip to content
Advertisement

WkHTMLtoPDF 0.12.2.1 PHP exec xvfb-run: Error: xauth command not found

I want to generate a PDF from a URL, so I execute the command by WkHTMLtoPDF as below:

JavaScript

The above command works fine on Terminal, But when I invoke the command inside PHP failed! And show me an error message as below:

JavaScript

I don’t know how to resolve this issue! Anyone can help me on this, my OS environment as below:

  • OS: CentOS release 6.6
  • wkhtmltopdf version: 0.12.2.1
  • nginx version: nginx/1.6.3

My PHP code as below:

JavaScript

Advertisement

Answer

For CentOS PHP environment the WkHTMLtoPDF tool not need xvfb-run to exec the command, But for Ubuntu PHP environment need xvfb-run to exec the command! I had revised my code as below and the issues was resolved:

JavaScript

The issues is currently resolved and Thanks @joaoBeno saved me for fixed this issue~~

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement