Are all these issues related to running PHP through a web server? And/or
in safe mode? (I'm not even sure it *should* work in safe mode.)
It works fine for me from PHP; but I think I've only ever tried it from
the commandline, and through PHPUnit. Here is the code I use (the
PhantomJS script has been built up in $s):
$temp_filename=tempnam(sys_get_temp_dir(),'UPJSB');
file_put_contents($temp_filename,$s);
$command="/usr/local/bin/phantomjs ".escapeshellarg($temp_filename);
$response=shell_exec($command);
Because my SSL tests access a server with a self-signed cert, the actual
command used is:
$command="/usr/local/bin/phantomjs --ignore-ssl-errors=true
".escapeshellarg($temp_filename);
Darren