Skip to content Skip to sidebar Skip to footer

Starting Phantomjs Server From Php And Waiting For It's Response

I wanted to run a phantomjs server from my php script, then do a curl request to it and read it's response (which in the final version will give a path to generated pdf). When runn

Solution 1:

You have several issues:

  1. phantomjs is started in the foreground, which means your php script stops/sleeps until phantomjs stops. Either start the phantomjs service, or run it in the background. See " php execute a background process " for an HowTo.
  2. The web server may probably not access the "graphical part" of your operating system, which means it cannot interact with your desktop. This is why the icon does not appear, but phantomjs should still start.

Post a Comment for "Starting Phantomjs Server From Php And Waiting For It's Response"