It's possible make a bridge from Java to php file?
I've got an application written in Java and I need execute http://piwik.org/ that is written in PHP. In the server I have PHP running but I cannot access from the browser to the php directory because all incoming traffic is redirected by apache to glassfish Application server.
So my idea is to use Java servlet to execute php files with:
Runtime.getRuntime().exec("php /path/to/file/file.php");
Then write the PHP output as java servlet response.
The only problems to accomplish this are:
How can I execute PHP cli that act like a browser?
Which parameters I need to pass to PHP to allow PHP to read or write cookie and session?