Uncaught exception 'JonnyW \ PhantomJs \ Exception \ InvalidExecutableException' in CentOS 6.7?

1

I'm trying to use php-phantomjs , install it using composer:

($ composer require "jonnyw/php-phantomjs:4.*")

The installation was successful but when I try to use it, with the basic example that comes in the page of: jonnnnyw

I'm getting the following error:

  

PHP Fatal error: Uncaught exception 'JonnyW \ PhantomJs \ Exception \ InvalidExecutableException' with message 'File does not exist or is not executable: /bin/phantomjs.exe'.

I have tried with many solutions like:

$client->getEngine()->setPath('/path/to/phantomjs');

chmod 777 etc without managing to solve it.

I am using it on a Dedicated Server with CentOS 6.7

I hope someone can help me, thanks.

    
asked by stewart 01.03.2018 в 01:10
source

1 answer

0

That more friend, the exception is clear, says that it can not find the file or it is not executable, it is an .exe, so the execution permission with chmod is not going to get executed because it is not an executable of linux, this executable is Windows, you can get it to run using WINE but that is not relevant at this time.

The solution I give you is to reinstall everything, but use the repositories for this, install phantomjs from the CentOS repositories or the linux version in your official page , and then if you install php-phantomjs.

EDITED 1

Because of my experience in Linux I would say that it is because of the executable, but because of my little experience in that particular technology, I tell you that if it does not work as I told you or you do not think that, take a look here , they had a similar problem with phantomjs and laravel, I do not go on to explain it for the same fact that it is not my fort and I would not have a joke to explain it.

    
answered by 01.03.2018 в 22:35