私はこのようなスクリーンショットを撮ろうとしています:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png");
しかし、それはscreen.pngを作成していません。しかし、
/usr/bin/wkhtmltoimage http://google.com screen.png
ターミナルから実行すると、期待どおりに動作します。何が悪いのか混乱しています。次のようなログを書き込もうとしました:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png > debug.log 2>&1");
debug.log に「QXcbConnection: 表示に接続できませんでした (コア ダンプ)」というログが表示されます。UbuntuにNginxとともにphp7.0をインストールしました。これに対する解決策は何ですか?誰かが同じことを解決した場合は共有してください。