PHP and TOMCAT


Results 1 to 9 of 9

Thread: PHP and TOMCAT

  1. #1
    Join Date
    Jan 2003
    Location
    Burnaby
    Posts
    116

    PHP and TOMCAT

    Does anybody know if TOMCAT support PHP at all?

    Thanks in advance

  2. #2
    Join Date
    Oct 2001
    Location
    /canada/ont/windsor
    Posts
    1,499
    Huh? Um, not that I know of. Its for Java. If PHP is installed on the server, you might be able to use both on a page maybe. I've embedded PHP in Javascript files before with out a problem. Can't say I've ever tried combining those 2 though.
    Where are we going and why am I in this handbasket?
    (No trees were killed in posting this message. However, a large number of electrons were seriously inconvenienced.)
    ----------------------------------
    Debian user since Potato
    Syngin: Web Portfolio

  3. #3
    Join Date
    Jan 2001
    Location
    Worcester, MA
    Posts
    722

  4. #4
    Join Date
    Jan 2003
    Location
    Burnaby
    Posts
    116
    Thanks for the replies.

    This looks promising
    http://wiki.apache.org/jakarta-tomcat/UsingPhp
    Last edited by ask_123; 03-21-2005 at 08:33 PM.

  5. #5
    Join Date
    Mar 2002
    Location
    Alton, Illinois, USA
    Posts
    1,126
    Originally posted by ask_123
    Thanks for the replies.

    This looks promising
    http://wiki.apache.org/jakarta-tomcat/UsingPhp
    you'd be better off configuring apache to serve php and java/jsp though the jk connector. there is a BIG performance boost to having apache use jk connector instead of having tomcat do things stand-alone.

    however it isn't easy to configure the connector and all the other java related settings. a local network box that gets just a few hundred hits a day might not be worth the trouble to set this up. however it is a good learning experience
    "You are not beaten until you admit it." --George S. Patton

    "Reading and learning, it's what linux users do"
    "Double clicking" doesn't work on Linux

    G4L | ZSH - The Z Shell

    Apple OS X, FreeBSD, and Smoothwall

  6. #6
    Join Date
    Jan 2003
    Location
    Burnaby
    Posts
    116
    I know I can use Apache + php + Tomcat, but would the performance gain you suggested be offsetted by the fact that I have to run an extra server ( I do not have a super fast server)?

  7. #7
    Join Date
    Mar 2002
    Location
    Alton, Illinois, USA
    Posts
    1,126
    Originally posted by ask_123
    I know I can use Apache + php + Tomcat, but would the performance gain you suggested be offsetted by the fact that I have to run an extra server ( I do not have a super fast server)?
    Well that depends. Apache + PHP is a trivial server setup. Apache + Java (though the jk connector) is more difficult to get working. I would still recommend using the Apache + PHP + jk_connector (which uses Tomcat) because the overall performance is a lot greater. JSP sites and java web based applications will serve quite a bit faster.

    What is the scope of what you are wanting to do? If the scope of what you want to do can justify the better part of a full work week to get this set up working (apache + php + tomcat connector) then do it. Other wise dont do it.

    Off hand, it might still be the most efficient way to do things. Apache blows Tomcat away in webpage serving and it should by every means serve php pages faster. With this setup the only thing Tomcat sees are the java requests which come to it from the connector. Tomcat is the weak link in this chain.
    "You are not beaten until you admit it." --George S. Patton

    "Reading and learning, it's what linux users do"
    "Double clicking" doesn't work on Linux

    G4L | ZSH - The Z Shell

    Apple OS X, FreeBSD, and Smoothwall

  8. #8
    Join Date
    Jan 2003
    Location
    Burnaby
    Posts
    116
    I think I shall try both and see what is the different.

    In my application, the servlet shall handle 90% of the request, while the PHP page shall handle rest 10%. Therefore, I inclined to stick to TOMCAT only. However, like what you said, it could be a good learning experience that may benefit me in the future, so I shall try both.

    Thanks for all the advices.

  9. #9
    Join Date
    Mar 2002
    Location
    Alton, Illinois, USA
    Posts
    1,126
    Originally posted by ask_123
    I think I shall try both and see what is the different.

    In my application, the servlet shall handle 90% of the request, while the PHP page shall handle rest 10%. Therefore, I inclined to stick to TOMCAT only. However, like what you said, it could be a good learning experience that may benefit me in the future, so I shall try both.

    Thanks for all the advices.
    Not a bad idea. At my old work we had large web applications that used JSP/Java for some of the logic and then PHP for other parts. We ran everthing though Apache and Java stuff through the mod_jk connector. But then when you're serving about 500 such sites the performance boost more than makes up for the config/install time.
    "You are not beaten until you admit it." --George S. Patton

    "Reading and learning, it's what linux users do"
    "Double clicking" doesn't work on Linux

    G4L | ZSH - The Z Shell

    Apple OS X, FreeBSD, and Smoothwall

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •