Thank you for your help.
I'm a new server user who recently started using Linux.
Capturing web pages (specifying URLs, rendering, and saving images) is a trial and error process.
You can even install "CuteCapt" and its association in CentOS 6 to run on SSH.
The command succeeds with the following
xvfb-run --auto-servernum --server-num=1CuteCapt --url=https://www.google.co.jp/ --out=/var/www/html/capture/Google.jpg
You would like to run this command from PHP.
(I have quite a history of PHP, but I have no experience of hitting commands outside, so I'm trying to guess...)
$res=exec(escapeshellcmd('xvfb-run --auto-servernum --server-num=1CuteCapt --url=https://www.google.co.jp/ --out=/var/www/html/capture/Google.jpg'));
I just put it in and found out that $res is
QXcbConnection:Could not connect to display:1
contains and no images are generated.
I understand that there is a moss around the connection to the virtual display.
I don't understand why a successful SSH command fails when I run it in PHP.
I don't know what to try next, so I'm on the rocks.
It may be a rudimentary misunderstanding or mistake, but
Thank you for your advice
I haven't verified it yet, but do you have a virtual display for xvfb?
Xvfb:90-ac-screen0 1024x768x24>/dev/null2>&1&
Run
DISPLAY=:90CuteCapt --url=https://www.google.co.jp/ --out=/var/www/html/capture/google.jpg
I'm sorry to be Selenium, but I think my article will be helpful.
582 PHP ssh2_scp_send fails to send files as intended
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
619 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.