私は自分のサイトで wkhtmltoimage を使用しようとしていましたが、ここでは機能していません。テスト サイトのコードです。
<?php
$output = shell_exec('/usr/local/bin/wkhtmltoimage --quality 95 --width 1024 --height 0 yahoo.com test1.jpg');
echo "<pre>$output</pre>";
?>
出力は空白のページです。面白いのは、shell_exec(ls -l)
;を実行したときです。の代わりに、
正常に動作します。ssh ターミナルから をshell_exec('/usr/local/bin/wkhtmltoimage --quality 95 --width 1024 --height 0 yahoo.com test1.jpg');
実行すると、wkhtmltoimage --quality 95 --width 1024 --height 0 yahoo.com test1.jpg
Loading page (1/2)
Rendering (2/2)
QPixmap: Cannot create a QPixmap when no GUI is being used ] 25%
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
Done
しかし、先に進み、jpg ファイルを作成します。
yahoo.com で同じコマンドを実行すると、次のようになります。
catarplc@zenbile.com [~/public_html]# wkhtmltoimage --quality 95 --width 1024 --height 0 yahoo.com test100.jpg
Loading page (1/2)
Error: Failed loading page http://yahoo.com (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed loading page http://yahoo.com (sometimes it will work just to ignore this error with --load-error-handling ignore)
さまざまなウェブサイトが私にさまざまなメッセージを与えてくれます。何が起こっているのか知っている人はいますか?私のサイトを作るために雇った人は、それはサーバーの問題であり、他に何もしたくないと言っています。私が私を助けるために支払ったことは、私を助けていません。誰でも助けてもらえますか?
ありがとうございました