Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:

Go Back   Caucho Forums > Quercus

Thread Tools Display Modes
Old 03-15-2011, 05:47 AM
nirajsalot nirajsalot is offline
Junior Member
Join Date: Mar 2011
Posts: 2
Default Call PHP Class From Java


We have PHP application , which is already developed and running on Apache.

Now we are writing new application which is written in Java. Now we would like to reuse the login which is already there in PHP.

We have decided to go with Quercus for doing this Integration.

PHP runs on Apache
and J2EE application Runs on Weblogic.

Now for example we have below mentioned PHP class running on Apache.

class Person {
var $name;

function gettest()
return "Welcome1";


How can I call this class & method gettest() from Java application which is running on Weblogic.

Kindly help me with a sample code for doing this.

Reply With Quote
Old 03-27-2012, 06:09 AM
andolasoft andolasoft is offline
Junior Member
Join Date: Mar 2012
Posts: 2
Default Call PHP Class From Java

I am writing a java class.And i have some logic in test.php One of the methods of that java class should invoke test.php so that test.php performs some computation and returns the result to the invoking java method. Can i do that with

runtime rt = runtime.getRuntime(); process exec = rt.exec(test.php);

Please suggest. Thanks in advance.
Reply With Quote
Old 03-30-2012, 05:08 PM
nam nam is offline
Join Date: Aug 2009
Posts: 337


There are various ways to call PHP from Java. One way is to use:

Value com.caucho.quercus.QuercusEngine.executeFile(Strin g path)
Reply With Quote

call class, java, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:34 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.