php-casperjs icon indicating copy to clipboard operation
php-casperjs copied to clipboard

No such file or directory

Open anagnam opened this issue 10 years ago • 6 comments

Hi,

I ran the example

$casper = new Casper(); $casper->setOptions(array('ignore-ssl-errors' => 'yes')); $casper->start('http://www.google.com'); $casper->fillForm( 'form[action="/search"]', array( 'q' => 'search' ), true); $casper->wait(5000); $casper->capture( array( 'top' => 0, 'left' => 0, 'width' => 800, 'height' => 600 ), 'Browser/custom.png' ); $casper->run(); var_dump($casper->getOutput());

I was expecting a png file and I got error below:

array(1) { [0]=> string(70) "Fatal: [Errno 2] No such file or directory; did you install phantomjs?" } Both libraries are installed.

Any idea what seems to be the prob?

anagnam avatar Oct 31 '14 17:10 anagnam

@anagnam hey I can't include Capser in my project for some reason and it tells me no Capser class found, can you tell me about your setup? Thanks

haroondilshad avatar Dec 26 '14 20:12 haroondilshad

@RonCan remote the useless //namespace Browser; Then add the final ?> in the end of the file.

After that, you can include the file directly: include 'lib/php-casperjs-master/src/Browser/Casper.php';

And you are good to go!

leopucci-zz avatar May 31 '15 16:05 leopucci-zz

is it still an issue?

alwex avatar Sep 15 '16 23:09 alwex

I have the same problem .. error : array(1) { [0]=> string(70) "Fatal: [Errno 2] No such file or directory; did you install phantomjs?" }

while i installed phantom and casper

amirkheirabadi73 avatar Sep 29 '16 06:09 amirkheirabadi73

It seems that casperjs is not able to find phantomjs, you should configure your path to make phantomjs available anywhere. for example:

export PATH=$PATH:/Users/Tom/Downloads/phantomjs-1.9.2/bin

alwex avatar Oct 12 '16 02:10 alwex

Hi, I have the same problem . But I have solve this problem use blow code before run php's exec function; putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs"); exec('...');

lezhizhe avatar Apr 14 '17 08:04 lezhizhe