Golden Fingers
Golden Fingers

Reputation: 79

Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in php-phantomjs

i can't get any data from php-phantom it's not working with me i found this error in php_log file when i tried get source page using php-phantom and this is the Full code

require 'vendor/autoload.php';

    use JonnyW\PhantomJs\Client;

    $client = Client::getInstance();

    $client->getEngine()->setPath('/home/XXXXXXX/public_html/bot/bin/');
    $client->getEngine()->debug(true);
   var_dump($client->getLog());

    $request  = $client->getMessageFactory()->createRequest();
    $response = $client->getMessageFactory()->createResponse();

    $request->setMethod('GET');
    $request->setUrl('http://jonnyw.me');

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

    if($response->getStatus() === 200) {
        echo $response->getContent();
    }

Upvotes: 0

Views: 1080

Answers (1)

Nabab
Nabab

Reputation: 2654

Try @ini_set('zlib.output_compression', 'off');

Upvotes: 1

Related Questions