Build your professional network on facebook via our app Go to app
 
 
Posted in Community :

Tech World

By : sameer kamble, IT Manager, indsoft systems
Activity:  14 comments  2858 views  last activity : 04 16 2012 05:38:34 +0000
 Refer 40
Share
 
 
 

Go to http://www.php.net/downloads.php and download the current version.

PECL modules : Event:http://museum.php.net/php5/pecl-5.2.5-Win32.zip

create "php" directory in folder C:\Program Files\Apache Software Foundation\Tomcat 6.0

Rename php.ini-dist to php.ini

Extract php5servlet.dll from the PECL zip file to C:\Program Files\Apache Software Foundation\Tomcat 6.0\php

create directory phptest under C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps

create sub directory WEB-INF in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\phptest

in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\phptest\WEB-INF create xml file "web.xml"

copy pest below code into web.xml
================================================

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">

<servlet>

<servlet-name>php</servlet-name>

<servlet-class>net.php.servlet</servlet-class>

</servlet>

<servlet>

<servlet-name>php-formatter</servlet-name>

<servlet-class>net.php.formatter</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>php</servlet-name>

<url-pattern>*.php</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>php-formatter</servlet-name>

<url-pattern>*.phps</url-pattern>

</servlet-mapping>

</web-app>
=============================================

Extract/unjar (using jar xvf or WinZip) php5srvlt.jar from pecl folder to : C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\tmp

Modify both C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\tmp\netreflect.properties and C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\tmp\netservlet.properties,

original code : library=phpsrvlt
replace with code : library=php5servlet

Jar the content of C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\tmp into a new version of php5srvlt.jar (command by command prompt: jar -cf php5srvlt.jar *.*)

Move php5srvlt.jar to C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\

Copy C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\php5servlet.dll and C:\Program Files\Apache Software Foundation\Tomcat 6.0\php\php5ts.dll to c:windowssystem32

Create a test page in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\phptest\test.php with this contents:  <?php phpinfo(); ?>

restart Tomcat and go to http://serevrip/phptest/test.php

 
11 comments on "configure php with tomcat"
  Commented by  sameer kamble, IT Manager, indsoft systems    | 01 28 2012 16:12:56 +0000
While installing payment gateway on windows server with java. its useful.
 
  Commented by  sameer kamble, IT Manager, indsoft systems    | 02 25 2011 15:25:11 +0000
this is full of RND work, i started php on tomcat after two days. 
  Commented by  Ankur Tripathi, Btech student, integral university    | 02 24 2011 22:09:57 +0000
nd haan this is the error inside the log file which is created under tomcat 
 "25 Feb, 2011 3:30:40 AM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized()"

nd dose php used for 64 bit system should be differnt as mine is 64 bit
my php version is 5.3.5
   pecl version is 5.2.5 win32
   tomcat 6
  Commented by  Ankur Tripathi, Btech student, integral university    | 02 24 2011 21:34:28 +0000
well thanks for ur quick reply...per sir jee how can i give u control of my system as i dont know u personally....no offence...

just to tell you my browser is able to display the html content of the file "test.php" if i include any in that.

but when i write only php code it displays a blank page
  Commented by  sameer kamble, IT Manager, indsoft systems    | 02 24 2011 16:52:09 +0000
@  Ankur
install ammy.exe  on your machine , or you can give me RDP of your server. then contacr me on g talk ,m always online, my id servtrix@gmail.com
  Commented by  Ankur Tripathi, Btech student, integral university    | 02 24 2011 13:41:05 +0000
@ sameer..

i dont know it is possible or not......how to do it????

actually i am a bit new to this stuff :)
  Commented by  sameer kamble, IT Manager, indsoft systems    | 02 24 2011 08:29:32 +0000
@  Ankur
Hi 
i need to check your server, is it possible?
  Commented by  Ankur Tripathi, Btech student, integral university    | 02 24 2011 00:52:29 +0000
Thanks for this....really appreciate ur effort

i did everything as illustrated step by step

but i couldnt the final test page.

i believe it should display information about PHP version etc...
but my browser displays the text written it that php.test file as it is....

any help would be great??
  Commented by  Anand Sharma, Monitoring the research funded by DIT, Department of Information Technology    | 12 21 2010 13:16:52 +0000
Thanks Sameer. It works......
  Commented by  sameer kamble, IT Manager, indsoft systems    | 12 15 2010 13:23:37 +0000
this is useful when you are integrate payment gateway in php  
  Commented by  akshaya bhatia, Program Manager (GM Projects-IT), fsl    | 12 15 2010 08:48:38 +0000
Useful info.,XAMPP is also good environ. to test PHP programs, Is there some advantage of configuring PHP with Tomcat?!
Add your comment on "configure php with tomcat"

Rate:
Submit
Leading Recruitment Firm
pl/sql, Unix shell scripting, Java J2EE, BSCS IX R2/R3, Consulting Firm, Bangalore
CCVP certification, Cisco IPT/ Cisco VOIP, Tech Mahindra, Noida
 
 
More From Author
The exceptionally low temperatures in northern India have led to the mercury closing in on single digits in the city in recent days. But the scorching, sweltering summers aren't far away and no one appreciates the malady more than a suburban rail...
While installing payment gateway on windows server with java. its useful.
Tips for avoid sleepiness During the Day at work
more...