Saturday, January 31, 2009

PHP In GlassFish

GlassFish is an App Server written in Java. So GlassFish does most of its work with the help of Java Servlets.

GlassFish does not have built-in support for PHP. Actually it can support PHP if a Java implementation of PHP exists for GlassFish. This was made available by Quercus Caucho at http://quercus.caucho.com/. Download the binaries and source of Quercus from the site.

Assuming that GlassFish is installed and its directory path is represented as "glassfish", proceed with the following steps -

  • Extract the contents of the archive downloaded from the Quercus Caucho website
  • Copy quercus.jar, resin-util.jar and script-10.jar from the WEB-INF/lib directory which is obtained from extracting the zip file to glassfish/lib directory
  • Open the file glassfish/domains/domain1/config/default-web.xml and add the following lines

<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
<init-param>
<param-name>ini-file</param-name>
<param-value>WEB-INF/php.ini</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>

  • The first set of configuration indicates that there is a servlet available under the name Quercus Servlet and the second set of configuration indicates that the servlet is to be run whenever a file with php extension is encountered

That’s it, restart GlassFish and it should be now be compatible to understand PHP.

26 comments:

Anonymous said...

Glassfish current versions have PHP support and they are available for download.

Anonymous said...

Hi...I am sandip...I was there at Sun Tech Days...were u there too? I met lot of CAs but forgot their names (coz I have a bad memory)...

Anonymous said...

...please where can I buy a unicorn?

Anonymous said...

unicorns in boxes of 6 can be picked up at your local unicorn seller

Unknown said...

Thanks for sharing informative article!!! Your article helped me a lot to understand the importance of PHP Training Center in Chennai to secure lucrative job in web design and development industry.

Unknown said...

Hello Admin, thank you for enlightening us with your knowledge sharing. PHP has become an inevitable part of web development, and with proper PHP training in Chennai, one can have a strong career in the web development field. We from Fita provide PHP course in Chennai with the best facilitation. Any aspiring students can join us for the best PHP training institute in Chennai.

Bay Max said...

Thanks for sharing this.PHP has a great scope in IT industry.PHP developers develop web sites,applications,etc using the dynamic scripting language.
Regards,
PHP Training in chennai | PHP course in chennai

Unknown said...

Really worth to read all info, thanks allot. Is there any other fastidious blog related to PHP? this one is good for PHP programming but I want to learn more and more about PHP.

Podiatry Website Marketing and Designing Solutions for Your Podiatry Practice.

navya said...

I have read your blog its very attractive and impressive. I like it your blog.

.Net Training in Chennai | .Net Online Training | Dot Net Training in Chennai

Dot Net Online Training | LINQ Online Training

Manjot kaur said...

Thank you so much for this post.

6 Months php Industrial Training
6 weeks php Industrial Training

Rathinam said...

This blog is very nice! You have been providing the valuable content and I was satisfied with your great post. I am always following your blog, please keep posting...
Linux Training in Chennai
Linux Course in Chennai
Best Linux Training Institute in Chennai
Excel Training in Chennai
Oracle Training in Chennai
Unix Training in Chennai
Tableau Training in Chennai
Embedded System Course Chennai
Oracle DBA Training in Chennai
Primavera Training in Chennai

SAP Training in Chennai said...

Marvellous...
SAP Training in Chennai
Java Training in Chennai
CCNA Training in Chennai
Pearson Vue Exam Center in Chennai
QTP Training in Chennai
Selenium Training in Chennai
Hardware and Networking Training in Chennai
SAP ABAP Training in Chennai
SAP FICO Training in Chennai
AWS Training in Chennai

Nisha said...

Informative and nice blog post. Thanks for this wonderful Post.
SAP Training in Chennai
AWS Training in Chennai
Hardware and Networking Training in Chennai
QTP Training in Chennai
CCNA Training in Chennai

TIC Academy said...

Great Blog. Thnaks.
SAP Training in Chennai
Java Training in Chennai
Software Testing Training in Chennai
.Net Training in Chennai
Hardware and Networking Training in Chennai
AWS Training in Chennai
Azure Training in Chennai
Selenium Training in Chennai
QTP Training in Chennai
Android Training in Chennai

Cho co said...

In Bangalore, you can take courses in this field, which will help you hone your skills in this field. 360DigiTMG data science training in hyderabad

Mithun said...

Thanks for this post.
Java Training in Chennai | Java Training Institute in Chennai | Java Training Center in Chennai | Best Java Training in Chennai | Java Training

EXCELR said...

"Very good article with very useful information. Visit our websitedata science training in Hyderabad
"

EXCELR said...

Excellent post and wonderful blog, Very good writing a university college and collecting information on this topic .I really like this type of interesting articles keep it up. data science training

Best VFX Course in Hyderabad said...

Looking for best Multimedia and Animation Institute in Hyderabad? Join CGCreed for courses in VFX film making, Digital Marketing, Web Design and Development, Graphic Design, 2D & 3D Animation & Visual Effects. Call +91 9859309309 for details.

Multimedia Course fees in Hyderabad

Unknown said...

Thanks for sharing this amazing piece of content and this post helps me a lot and I really like it. Its amazing thing. Looking for best vfx training in Hyderabad? For courses in VFX film making, Digital advertising, Web Design, Graphic Design, 2D & 3D Animation & Visual Effects visit Maacdilsukhnagar.

Diyalabs said...

Thanks for sharing such a helpful, and understandable blog. I really enjoyed reading it.

Robots for kids
Robotic Online Classes
Robotics School Projects
Programming Courses Malaysia
Coding courses
Coding Academy
coding robots for kids
Coding classes for kids
Coding For Kids
v

traininginstitute said...

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.
business analytics course

Priya Rathod said...

Thank you for taking the time to publish this information very useful!
Python Training in Hyderabad
Python Course in Hyderabad

Priya Rathod said...

I am impressed by the information that you have on this blog. It shows how well you understand this subject.
Data Science Training in Hyderabad
Data Science Course in Hyderabad

Ramesh Sampangi said...

Thanks for sharing this blog with us. Really awesome blog, information, and knowledgeable content. Keep sharing more.
Online Data Science Course in Hyderabad

traininginstitute said...

I am impressed by the information that you have on this blog. It shows how well you understand this subject.
full stack developer course