[cgiwrap-users] RE: cgiwrap and php?
Brought to you by:
nneul
From: Neulinger, N. R. <nn...@um...> - 2000-10-16 13:16:07
|
It's not really something in either direction that I'd really want to put in the mainline source. But you should be able to modify your local copy to do that easily enough. -- Nathan > -----Original Message----- > From: nicholas cole [mailto:ni...@pr...] > Sent: Sunday, October 15, 2000 10:59 PM > To: Nathan Neulinger > Subject: Re: cgiwrap and php? > > > on Thu, 28 Sep 2000, at 7:49am -0500 Nathan Neulinger wrote: > > > nicholas cole wrote: > > > > > > I've been on cgiwrap's mailing list looking around, and > > > since i'm just f'n confused about this, i thought i'd ask > > > you this as a start.. > > > > > > can php work with cgiwrap without putting a #! in the > > > script? > > > > > > personaly i don't have any problem putting a #! in my php > > > scripts, but i have customers that come in with php apps > > > that have shitloads of individual php scripts, just way too > > > many to add a #! to.. > > > > > > -- > > > nicholas cole > > > > I vaguely remember someone having mentioned making that > work. It would > > be a relatively easy fix in any case - just add some code to cgiwrap > > before the exec to automatically exec a script using a particular > > command. Although, I would suggest something like: > > > > if ( regular-exec-fails with a file-not-found error or similar ) > > { > > check filename > > if ( filename ends with .php ) > > { > > exec same command using php as interpreter > > } > > elsif ( filename ends with .pl ) > > { > > exec with perl... > > } > > else > > { > > generate error message > > } > > } > > > > Unfortunately, that probably would not take into account > that scripts > > without a #! are automatically fed to /bin/sh. > > > > You could just do that check+exec before the regular exec, but then > > there would be no way for a user to run a script using #! > that ran with > > a different perl or different php unless they did some sort > of exec in > > the script itself. > > > > I suppose if you had to, you could have cgiwrap open and > read the first > > couple of bytes of the script and only apply the > extension/exec check if > > the script didn't have a #!. > > > > -- > > Nathan > > I do like your idea, except for one thing, file extentions.. > > Consider for some fucked up reason Bob named his php scripts > with the extension .asdf. Now to get that to work with > cgiwrap without using #!, I'd have to recompile cgiwrap to > recognize that extension. > > Now correct me if I'm wrong here, but cgiwrapd is the same > as cgiwrap, and just does something different based upon > what it's run as.. So how about having cgiwrap-php and > cgiwrap-perl? That way nothing has to be done to get a new > extension to work with cgiwrap and be called using the > correct interpreter, without using #!. > > So when I get a customer who has php, perl, whatever scripts > named *.asdf on a server with forced cgiwrap usage, all I > have to tell them to do is add a handler for it in a > .htaccess file! =) > > How does it sound? > > -- > nicholas cole > > |