JSP / Servlet - PHP Integration Options JSP中/ Servlet的-P HP的集成选择
There are four different integration options in order of complexity and your requirements.有4种不同的整合选项,以便的复杂性和您的要求。 They are as follows:他们分别如下:
Multi-port Integration 多端口整合
Run Apache (with PHP) on default port 80 and Tomcat on default port (8080).运行的Apache (用PHP )就默认端口80和雄猫就默认端口( 8080 ) 。 They can run on the same machine with different ports without any problems whatsoever.他们可以运行在同一台机器上与不同的端口没有任何问题可言。 This is the simplest procedure.这是最简单的程序。
Single Port Integration (Apache Mapping) 单一港口一体化( Apache的映射)
In this scenario Apache and Tomcat runs on different ports as above.在这种情况下Apache和Tomcat和运行于不同的端口如上。 However Tomcat any application can be mapped to a path on Apache server.不过雄猫任何应用可以映射到一个路径对Apache服务器。 So it doesn’t appear to the end user that two servers are running.因此,它不会出现向最终用户认为,两个服务器正在运行的程序。 This is almost as simple as sbove.这是几乎一样简单sbove 。
Running PHP 5.x in Tomcat 运行PHP 5.x的在Tomcat
The link above provides a detailed tutorial along with helpful comments from users.上面的链接提供了详细的补习随着有用的意见,由用户。 This isn’t very complex to setup (more complex than above) but you have to carefully follow the steps.这不是很复杂的安装程序(复杂得多以上) ,但你必须仔细按照下列步骤进行。 This also allows invoking php code from within jsp and with some minor changes in reverse direction too.这还允许引用的PHP代码从JSP和与一些细微的变化,在相反方向。
Single Port Integration (Apache Tomcat Connector) 单一港口一体化( Apache Tomcat和连接器)
This is slightly better than the Apache mapping solution above.这是略优于Apache的映射解决以上。 You can configure it to run static html pages in Apache and dynamic JSP pages using Tomcat.您可以设定它运行的静态的HTML网页在Apache和动态JSP页面使用的Tomcat 。 However it is a installation / configuration hell (almost).不过这是一个安装/配置地狱(几乎) 。
For all of the above you can exchange data between the PHP and Tomcat by using the database, files, invoking appropriate URL with GET/POST data etc. Additionally you can directly communicate in the对于上述所有您可以交换数据之间的PHP和Tomcat和利用数据库,档案,引用适当的网址与获取/ POST数据等另外,您还可以直接沟通,在
running PHP 5.x in Tomcat运行PHP 5.x的在Tomcat solution.的解决办法。
Filed under提起下 Headline News头条新闻 , , How To如何 , , Java Software Java软件 , , PHP PHP的 , , Tech Note技术说明 , , Technology技术 , , Web网页 , , Web Services Web服务 | |
| |
RSS 2.0 2.0 | |
Trackback Trackback跟踪 this Article |此文章|
Email this Article电子邮件此文章
You may also like to read您也可以想读 |





































November 9th, 2006 at 9:33 pm 2006年11月9日在下午9点33分
Hi,嗨,
I’m do programming in jsp (in my site) which is need to invoke another URL/site which use PHP.我做的节目在JSP (在我的网站)这是需要引用另一个网址/网站使用PHP 。 The problem is I don’t know how to INVOKE in JSP.问题是我不知道如何引用在JSP中。
Exp:进出口:
mysite mysite的
http://abc.com/index.jsp
phpsite
http://def.com/index.php
from mysite i need to passing parameter to the phpsite and then get back the response/parameter from the phpsite.从mysite的,我需要通过参数来phpsite ,然后取回回应/参数从phpsite 。 In this situasion on phpsite was not allow to send redirect.在这situasion对phpsite是不容许发送重定向。 The only way is to INVOKE that page.唯一的方法是引用该网页。
Anyone have the idea please share with me to solve this problem.任何人有想法,请与我分享,以解决这个问题。
Thanks,谢谢,
jclabu. jclabu 。
November 30th, 2006 at 10:55 pm 2006年11月30日在下午10时55分
hai海