php-phantomjs icon indicating copy to clipboard operation
php-phantomjs copied to clipboard

$response->getStatus() return int(0)

Open atefBB opened this issue 9 years ago • 4 comments

Hey, I use this package with laravel 4.2 on windows 7 os, my code is: ` $client = JonnyW\PhantomJs\Client::getInstance(); $client->isLazy(); $client->getEngine()->setPath(base_path(). "/vendor/bin/phantomjs"); $request = $client->getMessageFactory() ->createCaptureRequest($some_url, GET'); $request->setTimeout(5000); $width = 1024; $height = 768; $request->setViewportSize($width, $height);

$request->setCaptureDimensions($width, $height, 0, 0);
$response = $client->getMessageFactory()->createResponse();

$client->send($request, $response); `

$response->getStatus() return int(0) and it save black picture ! any help?

atefBB avatar Dec 28 '16 13:12 atefBB

Do you try debugging?

$client->getEngine()->debug(true);
$client->send($request, $response); 
echo $client->getLog();

TechAlchemistry avatar Apr 27 '17 15:04 TechAlchemistry

From the phantomjs docs about installing on windows:

Note: For this static build, the binary is self-contained with no external dependency. It will run on a fresh install of Windows Vista or later versions. There is no requirement to install Qt, WebKit, or any other libraries.

TechAlchemistry avatar Apr 27 '17 15:04 TechAlchemistry

@RubtsovAV I'll try it ! thx!

atefBB avatar Apr 27 '17 15:04 atefBB

@RubtsovAV Tried logging and getting : QXcbConnection: Could not connect to display PhantomJS has crashed. Please read the bug reporting guide at and file a bug report. Aborted (core dumped) I am using ubuntu 16.04. , Laravel 5.5 And I want to be able to run this as headless...

mkantautas avatar Oct 11 '17 08:10 mkantautas