This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Java Products and Servers and the fly likes Getting Resin to ignore PHP script so that webserver deals with request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Getting Resin to ignore PHP script so that webserver deals with request" Watch "Getting Resin to ignore PHP script so that webserver deals with request" New topic
Author

Getting Resin to ignore PHP script so that webserver deals with request

Lloyd Lane
Greenhorn

Joined: May 08, 2005
Posts: 10
Hi,

I'm developing a Struts app and I need to upload images and have them automatically resized. My hosts lunarpages don't allow image manipulation in Java. The version of resin is 2.1. So what I've been trying to do is call a php script using a file upload inside a jsp which would upload then automatically resize etc. I've done php before and used the same script successfully before so its definately not a problem with the php.

At the moment all I get is the php code printing to the screen. THis made me think that resin is handling the request so I tried calling a simple php script with a print statement from a JSP where the php file is located underneath the struts app directory (which is underneath the webapps folder i.e. its not a root app) and that didn't work (prints the PHP code to screen as well), BUT calling the same script but this time located outside of my struts app and outside of the webapps folder (i.e. on the root level of my public_html) DID WORK.

I've done some digging around and found out that if you stick "plugin_ignore" for a directory in the web.xml then resin should ignore the file (php in this situation). So I tried it and it doesn't work.

Am I barking up the wrong tree?


These are the web-xml entries I tried (where the php files are located in a folder called PHP):


<servlet-mapping url-pattern="/home/*myusername*/public_html/webapps/tcms/php/*" servlet-name='plugin_ignore'/>
<servlet-mapping url-pattern="*.php" servlet-name='plugin_ignore'/>
<servlet-mapping url-pattern="/php/*" servlet-name='plugin_ignore'/>
<servlet-mapping url-pattern="*.php" servlet-name='plugin_ignore'/>



Should one of these entries not sort out my problem?

I guess the short term solution is to move the php scripts away from the webapps folder or make the app at root level but there must be a better way......

Can anyone help me?


Thanks

Lloyd
[ August 13, 2005: Message edited by: Lloyd Lane ]

SCP 1.4<br />SCWCD 1.4
Tero Ripattila
Greenhorn

Joined: Jul 13, 2005
Posts: 14
Hello Lloyd, I'd suggest having a look of the following pages:

[1] <http://www.caucho.com/resin-3.0/features/resin-3.0.8.xtp#PHP>

[2] <http://www.caucho.com/resin-3.0/thirdparty/php.xtp>

I guess FastCGIServlet would solve your problem even you're using an old version of Resin.

Best regards, Tero
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Resin to ignore PHP script so that webserver deals with request
 
Similar Threads
HTTP Status 404 servlet error ("The requested resource is not available")
unknown element `xsi:schemaLocation' in web-app
Force URL redirect from http to https?
Problems getting servlets to work on Tomcat 4
Problems getting servlets to work on Tomcat 4