The Source for Java Technology Collaboration
Webmaster Alert: Posting to Jive Forums is currently not working. Estimated time for fix is unknown.

Home » java.net Forums » GlassFish » GlassFish

Thread: PHP, Perl install to Glassfish

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 10 - Last Post: Jan 12, 2009 1:20 PM by: rotsen
bashpole

Posts: 1
PHP, Perl install to Glassfish
Posted: Jan 18, 2006 8:44 AM
  Click to reply to this thread Reply

Hi, can anyone help me understand how to add PHP and Perl support to a Glassfish server?

Thanks!
Ben

aaronanderson

Posts: 20
Re: PHP, Perl install to Glassfish
Posted: Jan 19, 2006 7:51 AM   in response to: bashpole
  Click to reply to this thread Reply

I don't think it is possible. I believe the entire HTTP server is written in Java so there is not a place to install a native isapi plugin. You may investigate using the ProcessBuilder class in a servlet to invoke some php code based on URL parameters

vbkraemer

Posts: 283
Re: PHP, Perl install to Glassfish
Posted: Jan 24, 2006 8:11 PM   in response to: bashpole
  Click to reply to this thread Reply

Another possibility is to use an Apache plugin (mod_jk, I think) to call GlassFish for servlet/jsp "stuff" and use mod_perl or mod_php(?) to suport those languages...

The amount of detailed information on this kind of configuration is pretty limited, though.

bjb

Posts: 57
About PHP
Posted: Jan 25, 2006 1:29 AM   in response to: vbkraemer
  Click to reply to this thread Reply

AFAIK, PHP got a Java Servlet SAPI to enable a Java Server to invocate a PHP. Give a look at PHP doc.

Never tried, but will be interrested to get feedback how it behave within glassfish...

http://wiki.apache.org/tomcat/UsingPhp

Rgs,
JB

peter_jones_jr

Posts: 1
Re: About PHP
Posted: Mar 11, 2006 11:14 AM   in response to: bjb
  Click to reply to this thread Reply

[nobr]<quote>http://wiki.apache.org/tomcat/UsingPhp</quote>
They claim that this only works with php4.

A better approach would probably be this:

http://www-128.ibm.com/developerworks/opensource/edu/os-dw-os-ag-tomcatphpger.html

But I don't know if glassfish can already load standard .ear files.[/nobr]

bjb

Posts: 57
Interresting alternative ...
Posted: Mar 13, 2006 1:47 AM   in response to: peter_jones_jr
  Click to reply to this thread Reply

Could be much stable !

You can "test case" this PHP by deploying "dotclear" a yet-another-nice PHP blog ...
http://www.dotclear.net/en/

Once pushed a simple PHP, there is a setup process that will install the system. All you need is a MySQL database running and a PHP module ready for it.

Getting back to GF, working on Java EE 5 and having issues to be fixed does not mean they have "damaged the legacy" (in other words it is still a J2EE 1.4 ).

So give it a try, I'll be glad to hear this runs as expected ...

Rgs,
JB

pepe

Posts: 369
Don't bother.. It's very easy if you have the right tool
Posted: Oct 1, 2006 3:13 AM   in response to: bjb
  Click to reply to this thread Reply

installing php to glassfish is an easy process and it works.
I just did it for an ubuntu (breezy badger) a few days ago.
You MUST NOT try any of the apache or php thingies, nor you should read their docs. Most of them are completely outdated and just cause confusion.
First, you must go to http://php-java-bridge.sourceforge.net/ which is a solution that works for current J2EE containers and current php.
Activating php for entire glassfish/sunapp server was to copy two jars (JavaBridge.jar and php-servlet.jar) into glassfish lib directory, then modifying the default-server.xml to include the servlet directives you can find in the howto.
Nothing complicated and simply works.

jfarcand

Posts: 74
Re: Don't bother.. It's very easy if you have the right tool
Posted: Oct 2, 2006 9:44 AM   in response to: pepe
  Click to reply to this thread Reply

I agree with "pepe" :-) The php-java-bridge is simple and probably the fastest way to make PHP works in GlassFish.

-- Jeanfrancois

rotsen

Posts: 1
Re: Don't bother.. It's very easy if you have the right tool
Posted: Jan 12, 2009 1:20 PM   in response to: pepe
  Click to reply to this thread Reply

Hi Pepe,

I am a rookie at glassfish and I am trying to set up glassfish and PHP and you mentioned
"modifying the default-server.xml to include the servlet directives you can find in the howto."
Where is the HowTo? to modify the default-server.xml

Thanks,

Rotsen

bjb

Posts: 57
Running PHP on Glassfish
Posted: Feb 15, 2006 1:54 AM   in response to: bashpole
  Click to reply to this thread Reply

Dear all,

Using the technique described on http://blog.taragana.com/index.php/archive/running-php-5x-on-windows-using-tomcat-4x-or-5x/ I was able to run PHP 5.1 inside Glassfish.

Small difference is that I had also to put php/ext in the path on win32 and I've chosen to create a WAR and then deploy it.

Please take care to refresh your cmd after updating the env !

From now, I do not see any more reason to use Apache classical HTTPD ;-)

Regards,
JB

lrwpinjava

Posts: 1
Re: Running PHP on Glassfish
Posted: Dec 12, 2008 1:05 PM   in response to: bjb
  Click to reply to this thread Reply

You can try out LRWPinJava at https://lrwpinjava.dev.java.net/. It supports running both Perl and PHP with Glassfish. You could run both language applications at the same time.




 XML java.net RSS