简体   繁体   中英

Slimerjs with exec linux centos 6

I just installed Slimerjs and no results on the web.

the slimerjs is found and commands like -help etc output like they should: exec('/usr/bin/slimerjs -help'.' 2>&1',$out,$ret);

but this line does not work

       exec('/usr/bin/slimerjs /var/www/html/capture.js'.' 2>&1',$out,$ret); var_dump($ret, $out); 

outputs only int(1); and nothing more. no errors in logs, it does not work. I can write everything I like if the bath is correct the output is always int(1).

Thank you

Had same issue now, just a minute ago. But I am using a combination of Casperjs with Slimerjs engine (Casperjs is a great tool for working with your slimerjs and phantomjs scripts, in a friendlier enviroment programming).

The working php script:

<?php 

putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
putenv("CASPERJS_EXECUTABLE=/usr/local/bin/casperjs");
putenv("SLIMERJS_EXECUTABLE=/usr/local/bin/slimerjs");
putenv("DYLD_LIBRARY_PATH");

echo passthru('/usr/bin/xvfb-run /usr/local/bin/casperjs --ssl-protocol=any --proxy-type=auto --engine=slimerjs casperjsscript.js 2>&1'); 

?>

You could perhaps check to include some of the paths, as indicated seen in my script and make a few changes, or just install Casperjs :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM