Search |
||
100% Java Quercus PHP engine running in GlassFish Java EE 5 Application Server...Posted by ludo on March 9, 2007 at 9:53 PM PST
Bonjour, Comment Java?
I spent a few hours playing with Quercus, the Caucho Technology's 100% Java implementation of PHP 5, trying to make it run with the GlassFish Java EE 5 application Server. Quercus comes with many PHP modules and extensions like PDF, PDO, MySQL, and JSON. Download the quercus engine war file. Unzip this quercus-3_1-snap.war war file, and copy the 2 files quercus.jar and resin-util.jar from the WEB-INF/lib archive directory to the GlassFish lib/addons directory (GLASSFISHINSTALLDIR/lib/addons) If the GlassFish Application Server is not using JDK 1.6, but only JDK 1.5, you'll also need the javax.scripting.* JSR 223 apis. You can get the jsr223-api.jar file from the Phobos CVS repository, and store it as well under the GLASSFISHINSTALLDIR/lib/addons directory. One final configuration file for php is needed. It is called GLASSFISHINSTALLDIR/domains/domain1/config/php.ini and should contain as a minimum this property value: default_mimetype=text/html Nothing more, nothing less. (If you are using a different GlassFish domain, just put this php.ini file in the domain's config directory. So to recap, this is the files you should have on disk for configuring a PHP engine with GlassFish:
That's it... Now using your favorite IDE (vi, or NetBeans), you can create a simple Web Application, and what you need to do is declare the PHP engine as a servlet and the location of the php.ini file, as follow: <?xml version="1.0" encoding="UTF-8"?> Now you are all set: this Web App is PHP ready. Just Add PHP files under the web folder area, where you would put your JSPs files. The simplest index.php can be: <?php If you want to test the Java interoperability, you can go wild and crazy with this: <?phpOr even crazier, you can test that the Ajax jMaki project is working also in PHP applications, including the ones using the Quercus PHP pure Java engine running int he GlassFish Java EE 5 container...The sky is the limit. A complex PHP application is MediaWiki.
Untar the mediawiki PHP application archive inside the WEB-INF area of
your web application, and redeploy it (if you are using NetBeans, you
have almost nothing to do as NetBeans does an update of the deployed
build area when files are modified in the source area). Activate the
Web Application at the correct URL to see if MediaWiki 1.9.3 home page
is correct as below:
Here is the PHP index page... <?phpThe setup page as rendered with Pure Java Quercus PHP engine on GlassFish: (Sorry, I did not have the time to configure the MySQL database yet)
For more info, read http://quercus.caucho.com/ and the documentation under http://quercus.caucho.com/quercus-3.1/index.xtp . The pure Java PHP engine is still an Alpha version, so please try it, break it and give feedback. The list of PHP applications the caucho team will be testing is very impressive:
And do not forget that the Ajax jMaki project is PHP friendly, and JSP friendly, and Server Side JavaScript Phobos friendly... A Plus, Ludo »
Related Topics >>
Java Enterprise Comments
Comments are listed in date ascending order (oldest first)
Re
Submitted by aaronkolodjski on Thu, 2009-12-31 11:58.
Thanks for sharing, been a reader for some time now, keep up the fantastic job! Wishing you the best new year to come.
Aaron
MN | web hosting
Java platform can be
Submitted by sarafoster on Thu, 2010-01-07 12:31.
Java platform can be connected with oracle because if i need more stable network then i need to use Oracle. e lottery
This is Milestone 1 of
Submitted by jina2010 on Sat, 2010-01-09 16:27.
This is Milestone 1 of NetBeans 6.8 and Java EE 6 support with the latest GlassFish v3 (build 57). The bundle is only 132Mb and contains everything you need to start with Java EE 6: the IDE, the Java EE 6 current runtime, the JavaEE 6 JavaDocs (for code completion), the JavaDB database
Bollywood Stars Photos | Ayesha Takia Images | Kareena Kapoor Images
Mobile applications are
Submitted by sarafoster on Sun, 2010-01-10 22:01.
Mobile applications are mostly done into the JE platform. Marketing For Dentists
Yes, certainly a milestone -
Submitted by rocko22 on Wed, 2010-01-20 16:34.
Yes, certainly a milestone - well done to all those involed. cheap auto insurance.
"today is some type of
Submitted by gm0nk3y1 on Fri, 2010-01-29 12:22.
"today is some type of historical milestone for Java EE 6: This is Milestone 1 of NetBeans 6.8 and Java EE 6 support with the latest GlassFish v3 (build 57). The bundle is only 132Mb and contains everything you need to start with Java EE 6: the IDE, the Java EE 6 current runtime, the JavaEE 6 JavaDocs (for code completion), the JavaDB database, and very very cool features from the plaform or its implementation" - I agree about get ex back and get my ex back
Hi Ludo, I tried taking it
Submitted by markweee on Tue, 2009-12-08 00:34.
Hi Ludo, I tried taking it for a spin, but I couldn't get facelet page editing to do anything useful. The editor insisted that the facelets pages were plain HTML files. Is there some secret switch? Thanks, Cay Diploma Programs AND Online Certificate Program AND Degree Programs
very interesting ! Thank you
Submitted by stopier on Tue, 2009-12-29 13:16.
very interesting ! Thank you for this great article ! By the way, i love Fashion designers and Hedi Slimane !
Java apps for mobile games i
Submitted by sarafoster on Mon, 2010-01-11 16:05.
Java apps for mobile games i need J2ME J2EE platform No Prescription Online Pharmacy
Hi there!
Submitted by rken on Fri, 2010-01-15 00:26.
Good instructions and it's quite interesting.
Submit free articles at http://www.articlemonkeys.com/
Java platform can be
Submitted by garrywert on Sat, 2010-01-16 13:06.
Java platform can be connected with oracle because if i need more stable network then i need to use Oracle. ben 10: alien force season 3 episode 13 | dollhouse season 2 episode 11 | ghost adventures season 3 episode 10
Yeha very Useful information
Submitted by brouise on Tue, 2010-01-26 01:16.
Yeha very Useful information , this is both good reading for, have quite a few good key points, and I learn some new stuff from it too, thanks for sharing your information. handbags wholesale handbags
Finally, an issue that I am
Submitted by jeff888 on Thu, 2010-01-28 20:43.
Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated. copy xbox 360 games|wow leveling guide|watch satellite tv on pc|xbox 360 repair guide|Perfect Golf Swing|Joana's Horde Leveling Guide Review|warcraft millionaire|Game Copy Pro Review|How to Make Money on eBay|legitimate paid surveys
RE: Finally, an issue that I am
Submitted by wrihelp on Wed, 2010-02-03 23:09.
This is Milestone 1 of NetBeans 6.8 and Java EE 6 support with the current GlassFish v3 build 57
Thesis | Dissertation | Essay | Assignment
Quercus
Submitted by christmassms on Fri, 2010-01-29 13:26.
Wow, that's awesome, I am addicted using Quercus, I used it on many sites and it has provided me with great features. Just read you post about Quercus and I decided to add my experience. Now it is becoming more popular among the MediaWiki 1.9.3 but 2.0 is great. Thanks for sharing. finger pulse oximeter
ClassNotFoundException
Submitted by xuqingkang on Mon, 2010-02-01 22:34.
Hi:
I am using Sun GlassFish Enterprise Server v2.1.1 on JDK1.5.0_17
i had copied following files into GLASSFISHINSTALLDIR/lib/addons + quercus.jar (taken from the quercus-3_1-snap.war) + resin-util.jar (taken form the quercus-3_1-snap.war) + jsr223-api.jar (taken from Phobos CVS repository) and i have the php.ini * domains/ o domain1/ + config/ # php.ini that contains default_mimetype=text/html but when i deploy the web application which contains index.php,i can't visit it due to following ClassNotFoundException exception. how can i fix it? java.lang.ClassNotFoundException: com.caucho.quercus.servlet.QuercusServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1578) at org.apache.catalina.core.StandardWrapper.loadServletClass(StandardWrapper.java:1273) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1049) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:848) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:382) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) BTW:i tried to put the three jars(quercus.jar...) into web application's WEB-INF\lib directory. it works, i can see the "hello world" when i visit the web application。 |
||
|
today is some type of