Is it possible to make a bridge from Java to php file?
I have an application written in Java and I need to run http://piwik.org/ , which is written in PHP. PHP is running on my server, but I can’t get access from the browser to the php directory, because all incoming traffic is redirected by apache to the Glassfish application server.
So my idea is to use a Java servlet to execute php files with:
Runtime.getRuntime().exec("php /path/to/file/file.php");
Then write the PHP output as the response of the Java servlet.
The only problems for this:
How can I execute PHP cli that act as a browser?
What parameters do I need to pass to PHP so that PHP can read or write cookies and session?