Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Lloyd Lane
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Tero Ripattila
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic