I\'m using PhantomJS 64 bit in my PHP application to dynamically capture an HTML page to be emailed to the user.
phantomjs rasterize.js \"http://...\" /path_to_i
UPDATE: This great article by Arlo Carreon points out how to make this work on HostGator shared hosting (this was my problem). Simply add 2>&1
at the end of the command to redirect the output. The 64 bit version still does not work but this fixes the 32 bit version.
It turns out that this only happens when the PHP script is requested through the Apache web server. The workaround is to create a database entry for users that need to receive the email and setup a cron to execute the PHP script that calls PhantomJS for each user entry in the DB. When the cron is set to run at the smallest interval the user perceives that the email was generated and sent immediately.