NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP scripts running in JBoss

Artur Marnik artur at marnik.net
Mon Feb 23 16:59:59 EST 2009


> 
> There are a few ways to approach PHP/JEE application server integration, 
> and the solution you pick depends on the answer to a few questions:
> 
> - Is this a straight conversion of your applications from PHP to Java? Or 
> do you intend to leave some portion in PHP?

temporary we will leave our PHP code but the long term goal is to 
translate everything to Java

> - Do you need your PHP and Java application modules to communicate with 
> each other?

this is not that important but it might be required in some cases (worst 
case scenario we can solve it using XML or other method)

> - What sort of transition plan are you looking at?  Phased, or complete in 
> one shot?   Only new features in Java?

phased - new features in Java and gradually transferring old code to 
Java as well

> - What benefit - besides being more comfortable with Java as a language - 
> is your manager looking to get from Java as a platform?  PHP is better at 
> some things, Java, others.

this is out of the question at all - we tried we failed - we have to go 
with Java

> - Why JBoss and not just Tomcat or Geronimo?  Or any other JEE application 
> server for that matter?

same as above

> 
> In my opinion, the best place to start is to use Apache as a front end to 
> both your PHP and JEE applications, and let Apache decide which to 
> delegate the request to based on the URL pattern. 
> 
> In this scenario, JBoss and PHP would know nothing about each other, but 
> could share data via MySQL or client-side cookies.   This is good for 
> supporting a phased approach and keeps your inter-Java/PHP dependencies to 
> a minimum.

this is what I was thinking but pressure is to have jboss (with tomcat) 
on the first line and then if request is meant for php then send it to 
apache (which can be run internally with no problems)

> 
> This article is close to 4 years old, but it covers this scenario in a 
> WebSphere specific way (though the concepts are generic):
>    Pair J2EE with PHP to implement a common Web application infrastructure
>    
> http://www.ibm.com/developerworks/websphere/techjournal/0505_krook/0505_krook.html
> 
> You could also explore PHP / Java integration via a bridge using several 
> approaches:
>    http://krook.net/archives/191
> 

thanks - will check the links

> Or, use a PHP interpreter written in Java (my least favorite option... but 
> gaining in popularity), integrating Java and PHP in the same JVM, which is 
> what Quercus, Project Zero and others do:
>   http://www.projectzero.org/
>   http://www.caucho.com/resin-3.0/quercus/
> 

this is interesting - that might actually work

> 
> 
> Thanks,
> -Dan
> 
> 


thanks a lot
Artur



More information about the talk mailing list