Page 1 of 1

Run JAVA from PHP

Posted: Wed Jan 14, 2009 11:03 am
by svirid
Good day,

I am developing a small wrapper in JAVA around a Lucene Text Search. Basically what I does, it receives query from the user passes to Lucene, does the search and Lucene returns result, wrapper creates XML of it a returns as a String.

So basically I execute my .jar via command line using exec in PHP, and on return I receive XML string that PHP parses.

My question is, how good is this way from the performance point. Many people are using phpjavabridge to connect PHP and JAVA, but it requires additional install on a server. My way is simple requires just a javac compiler so I can run my jar via it.

Can u please tell me if I am on a wrong or right way by running java this way.

And what would be the best way from the speed point to run java via PHP

Thank you very much for your help.

Re: Run JAVA from PHP

Posted: Wed Jan 14, 2009 7:01 pm
by Cirdan
An alternative could possibly be the Lucene search implementation in the Zend framework.