RE: [PHP4BETA] JSP vs. PHP - Two vs. Three Teir
| From: | rubys at us dot ibm dot com | Date: | Thu, 06 Apr 2000 18:18:09 +0000 |
| Subject: | RE: [PHP4BETA] JSP vs. PHP - Two vs. Three Teir | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13245@lists.php.net to get a copy of this message | ||
> Three-teir. Exluding browser. I'm speaking PHP in a middle-ware sense.
> The problem with PHP's access to Java from what I understand is that the
> JVM is launched for every Java request-- not very efficient.
>
> thank you for your reply. ;) Anyone else?
Not true. Or more precisely, it is your choice.
If you configure PHP as CGI, then a JVM will be launched per request which
makes use of Java services. This is done dynamically, so if a given
execution of a request does not require the use of Java, no JVM will be
launched, even if the java extension is configured.
If you configure PHP as part of a traditional web server (e.g.,
--with-apxs), then one JVM will be launched per process, again on as needed
basis. Once the JVM is launched it will remain until the server
terminates.
If you configure PHP as a servlet, then PHP will use the existing JVM. If
the servlet engine is multi-threaded, then each concurrent PHP request will
run under the same JVM under its own thread. (PHP's internal semaphores
may limit the extent to which work is overlapped, but that is another
story).
Furthermore, PHP as a servlet is fully interoperable with both JSP and
servlets - meaning that you can freely mix and match the use of both on the
same site.
- Sam Ruby