The problem is this: installed php phantomjs on MAMP. I did everything according to the instructions from here: enter the description of the link here

Everything was installed and working well ... Then I copied my hosting files and everything stopped working. Made var_dump server response, as I understand it, and got the following:

object (JonnyW \ PhantomJs \ Http \ Response) # 156 (8) {["headers"] => NULL ["status"] => NULL ["content"] => NULL ["contentType"] => NULL [" url "] => NULL [" redirectURL "] => NULL [" time "] => NULL [" console "] => NULL}

Why it may not work, and actually all returned values ​​are 0? My code is below:

require __DIR__ . '/vendor/autoload.php'; use JonnyW\PhantomJs\Client; $client = Client::getInstance(); $request = $client->getMessageFactory()->createRequest('http://jonnyw.me', 'GET'); $response = $client->getMessageFactory()->createResponse(); var_dump($response); $client->send($request, $response); echo $response->getContent(); 

    1 answer 1

    If you believe the source code https://github.com/jonnnnyw/php-phantomjs/blob/master/src/JonnyW/Phant-Jom/Procedure/Procedure.php#L106 ,

    this is most likely a problem or with http://php.net/manual/en/features.safe-mode.php

    it is possible that http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen can also influence (I can lie here).

    Options:

    1. Ask the host to disable safe-mode (enable allow-url-fopen)
    2. Use another library that does not have this problem.
    3. Host yourself on a virtual / hardware server (aws / openshift / digitalocean ...)