Here are steps to install and run php in tomcat server.
- Download and install latest java from Oracle http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Set java_home in system classpath
- Download latest tomcat from “http://tomcat.apache.org/download-70.cgi” and unzip c:\tomcat
- Download latest php for window “http://windows.php.net/download/”and unzip to a directory,
c:\php
- Set path in you system for php folder like
path=%path%;c:\php
- Download latest PECL Win32 binaries from http://museum.php.net/php5/ like download “pecl-5.2.5-Win32.zip”
- Download latest PHP-JAVA Bridge war file from http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/
- Go to you php installation folder c:\php and rename “php.ini-production” file to “php.ini” file
- Add the new line (If does not exist) in new php.ini:
;extension=php_java.dll
- Copy php5servlet.dll from PECL 5.2.5 to c:\php
- copy php_java.dll from PECL 5.2.5 to
c:\php\ext
- Copy downloaded ” JavaBridgeTemplate621.war” to tomcat\webapps folder and rename as php.war
- Now start tomcat and access you php-java bridge application and test your php file “http://localhost:8080/php/”
- If you are creating any php file it should go in tomcat\webapps\php\ folder
If you are getting Error “Could not start FCGI server: java.io.IOException: PHP not found. Please install php-cgi” then MSVCR110.dll is missing from your system. Please install Visual C++ library from Microsoft website “http://www.microsoft.com/en-us/download/confirmation.aspx?id=30679”. Make sure you download and install the x86 version not 64bit version

Rajnish Kumar, the CTO of Vanrish Technology, brings over 25 years of experience across various industries and technologies. He has been recognized with the “AI Advocate and MuleSoft Community Influencer Award” from the Salesforce/MuleSoft Community, showcasing his dedication to advancing technology. Rajnish is actively involved as a MuleSoft Mentor/Meetup leader, demonstrating his commitment to sharing knowledge and fostering growth in the tech community.
His passion for innovation shines through in his work, particularly in cutting-edge areas such as APIs, the Internet Of Things (IOT), Artificial Intelligence (AI) ecosystem, and Cybersecurity. Rajnish actively engages with audiences on platforms like Salesforce Dreamforce, World Tour, Podcasts, and other avenues, where he shares his insights and expertise to assist customers on their digital transformation journey.