I was adding PhantomJS into an existing PHP script and running passthru(‘phantomjs …..’); just wasn’t working. A few tips: If you’re running the script locally, add export DISPLAY=:0 to the PHP passthru() If you’re running the script on a remote host make sure someting like Xvfb is installed, then run nohup Xvfb :40 -ac -screen 0 1600x4000x24 & […]