php-phantomjs
php-phantomjs copied to clipboard
empty response
Hello
I'm trying to run the basic usage example on windows but i keep getting empty response
object(JonnyW\PhantomJs\Http\Response)[2135] public 'headers' => array (size=0) empty public 'status' => null public 'content' => null public 'contentType' => null public 'url' => null public 'redirectURL' => null public 'time' => null public 'console' => null
Try installing the executable from the website and pointing the installation at it.
$client = Client::getInstance();
$client->getEngine()->setPath('\path\to\phantomjs\executable.exe');
I'm not sure if the path should use backslashes or forward slashes with your environment so change accordingly.
i solved this issue but now when i try to execute the
Outputting a page as PDF (or jpg)
example ,the $client->send($request, $response);
never returns
I have the same issue, @gkalligeros PLZ how did you solve it? thx !
the returned response is :
object(JonnyW\PhantomJs\Http\Response)#581 (8) { ["headers"]=> array(0) { } ["status"]=> NULL ["content"]=> NULL ["contentType"]=> NULL ["url"]=> NULL ["redirectURL"]=> NULL ["time"]=> NULL ["console"]=> NULL }.
setPath fixed it for me, I was able to determine the path by running which phantomjs from the command line.
I solve the issue by doing this :
$client->getEngine()->setPath(base_path() . '/vendor/bin/phantomjs');
(base_path is a laravel helper function)
setPath to ~/phantomjs.exe may cause prob (in this case, I'm using debian server) !
Hope that help someone !
Same problem for me and $client->getEngine()->setPath() has not resolved the issue...
I think proc file is failed。。。Because i'm not use proc file can return right.