Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

php as a servlet

 
mahesh narayan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was trying to run php as a servlet in websphere application server. But hard luck... i am just not able to figure out how to go about it.... can anyone help me ?

rgds
Mahesh
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a Servlet is Java, PHP is not.

Mark
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tomcat we have the CGI servlet that lets you run PERL cgi scripts, seems to me you should be able to use it to run PHP scripts.
Bill
 
mahesh narayan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Mark for being vague about my question.What i meant was to ask whether i can integrate PHP into a Java Servlet environment. Though i could find some doc on googling, but it couldnt help me how to do tht in websphere application server.It would be really helpful if someone can provide me pointers on how to do it.

thanks
Mahesh
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call Java Code from PHP - there is a Servlet SAPI module, which you can get if you look on PHP's site. Or you can use the Java Extension stuff (again, look on PHP's site) but that's very definitely at the alpha stage. Take this all with a pinch of salt though - Java is a far richer language than PHP, so you are bound to fine some horrible gotchas trying to use them in the same app.
 
mahesh narayan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul.

I have used Java Bridge to call java from Php. And is seems to work fine.

rgds
Mahesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic