Skip to content
Advertisement

PhantomJS doesn’t work in PHP through browser (but does via command line, and even by running PHP through command line)

I’m trying to get PhantomJS to run via PHP.

When I run the JavaScript file directly through the command line, it works fine. When I run php render_html.php in the command line, which just runs an exec(), it works fine. However, when I try opening this php file in the browser, it does nothing. I don’t even get anything back to echo.

I’ve done all this testing locally on OS X, and on my EC2 server, and I get the same result.

Advertisement

Answer

It might be a permission problem, check if the user running the web server has permission to run the phantomjs executable.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement