php - Installing PhantomJS on server -


i'm using phantomjs on windows , accessing files through command line. want install on server i'm working on local host want installed on apache, may integrate phantom html , php used within web page. i'm using windows 8.1 , apache server localhost.

can that? how use in web services now? how use if have make web online? should have t ask hosting provider place thing on server me?

i'm using phantomjs develop web service takes url input , returns image file of screen shot of website.

the "installation" of phantomjs adding path path environment variable.

running through php

since you're using php, invoke phantomjs php script shown here need provide full path phantomjs executable. can use putenv extend path directly php seen here.
can return phantomjs script in $output variable of exec , parse it.

running through webserver module

phantomjs provides web server module. can write script listens requests, creates page on request , returns image. somehow run script @ startup or apache. it's possible write wrapper can run windows service. may possible pass requests through apache phantomjs not open outside.
although option little treacherous, because phantomjs may fail , need kind of reviving mechanism. script may run memory leak.

returning image

both of above options agnostic how return image. there several possiblities.

  1. on request, create random , unique filename , render page file. can send name of file client might request afterwards. needs 2 requests.
  2. on request, render page through renderbase64 receive plain image data. can send image data directly in response , client may put dom via data:-uri.

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -