0

I installed PhantomJS on my local web server (MAMP) and had no any problems with it, but when i uploaded my site folder on my web hosting, it wrote me the next message:

Fatal error: Uncaught exception 'JonnyW\PhantomJs\Exception\ProcedureFailedException' with message 'Error when executing PhantomJs procedure "default" - File does not exist or is not executable: bin/phantomjs' in /home/gorecky/hotshoppingdeals.net/omlife/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php:132 Stack trace: #0 /home/gorecky/hotshoppingdeals.net/omlife/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php(170): JonnyW\PhantomJs\Procedure\Procedure->run(Object(JonnyW\PhantomJs\Client), Object(JonnyW\PhantomJs\Message\Request), Object(JonnyW\PhantomJs\Message\Response)) #1 /home/gorecky/hotshoppingdeals.net/omlife/index.php(81): JonnyW\PhantomJs\Client->send(Object(JonnyW\PhantomJs\Message\Request), Object(JonnyW\PhantomJs\Message\Response)) #2 {main} thrown in /home/gorecky/hotshoppingdeals.net/omlife/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Procedure/Procedure.php on line 132

What can be a reason of this fatal problem?

My code used in index.php is:

require __DIR__ . '/vendor/autoload.php';

  $client = \JonnyW\PhantomJs\Client::getInstance();
  $request = $client->getMessageFactory()->createRequest($link, 'GET');
  $response = $client->getMessageFactory()->createResponse();
  $client->send($request, $response); 
  $html = $response->getContent();

Thank you for help!

  • 2
    > *File does not exist or is not executable: bin/phantomjs*. So, does this file exist? Is it executable? – pawel Feb 11 '16 at 10:30
  • @pawel Sorry for such question, maybe i don't understand smth) All i've done - was copying my project folder from local disk to my web hosting folder... On my local server Phantom works without any problems... – Artyom Sosonko Feb 11 '16 at 10:45
  • Try running `chmod +x bin/phantomjs` – Alexander Mikhalchenko Feb 11 '16 at 10:48
  • @AlexanderM. i'm sorry, where should i do this?)) – Artyom Sosonko Feb 11 '16 at 10:49
  • Probably it is a permissions issue. Check that php has correct permissions and required file is executable. – Gino Pane Feb 11 '16 at 10:49
  • @ArtyomSosonko well, basically you should `cd` to a folder with `phantomjs` file and execute `chmod +x phantomjs` there, so you should find where the `phantomjs` is. In order to find, this should help: http://stackoverflow.com/a/13131063/2044039 – Alexander Mikhalchenko Feb 11 '16 at 10:53
  • @AlexanderM. Thank you for answer, i've made what you said... and sh-3.2# ls .DS_Store composer.json geo_ip.dat index.php vendor .htaccess composer.lock geo_ip.php main.js bin composer.phar img styles.css sh-3.2# chmod +x phantomjs chmod: phantomjs: No such file or directory – Artyom Sosonko Feb 11 '16 at 11:05
  • i'm sorry, it seems that enough : sh-3.2# chmod +x phantomjs chmod: phantomjs: No such file or directory – Artyom Sosonko Feb 11 '16 at 11:05
  • What does `find ~ -type f -name "phantomjs"` give to you? – Alexander Mikhalchenko Feb 11 '16 at 11:28
  • @AlexanderM. gives nothing, returns empty line( – Artyom Sosonko Feb 11 '16 at 11:32
  • 1
    @ArtyomSosonko have you actually dwnloaded and installed phantomjs? Here's an instruction how to get php-phantom up and running http://stackoverflow.com/a/20216210/2044039 – Alexander Mikhalchenko Feb 11 '16 at 12:19
  • Thank you, I'll try it for few hours) my local MAMP project had phantom installed with the help of composer, like symphony too... So the first think was to install phantom via official package) – Artyom Sosonko Feb 11 '16 at 12:28

0 Answers0