Run JAVA from PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
svirid
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 10:59 am

Run JAVA from PHP

Post 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.
Cirdan
Forum Contributor
Posts: 144
Joined: Sat Nov 01, 2008 3:20 pm

Re: Run JAVA from PHP

Post by Cirdan »

An alternative could possibly be the Lucene search implementation in the Zend framework.
Post Reply