You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Omer Shenker <ma...@omershenker.net> on 2003/06/01 13:11:40 UTC

[users@httpd] Re: Problems using PHP filters with mod_cgi

On Saturday 31 May 2003 at 21:54 WC -Sx- Jones wrote:
> You sure you don't get "bar"  --  I mean that should be what 
> is printed 
> IF php was eval'ing like you state...

Yeah, I'm sure. The PHP evals but then the Perl doesn't. Or vice versa,
depending on the configuration. But I can't get them both to eval for the
same request--and the Perl needs to eval first anyway.

-- 
Omer Shenker                          http://omershenker.net/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Problems using PHP filters with mod_cgi

Posted by WC -Sx- Jones <li...@insecurity.org>.
On Sunday, June 1, 2003, at 10:51  AM, Omer Shenker wrote:

> ExtFilterDefine phpfilter cmd=/usr/bin/php mode=output
> ftype=AP_FTYPE_CONTENT_SET
> ...
> AddHandler cgi-script .cgi
> AddOutputFilter phpfilter .cgi
>
> This does indeed give me foobar (at last!), but it's a very inefficient
> kludge.


Well, you are make TWO different scripting langauges work "closer" 
together  :)


I think I almost have AddOutputFilter working -- if I do I will post 
the results...

-Sx-


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Problems using PHP filters with mod_cgi

Posted by Omer Shenker <ma...@omershenker.net>.
I think I've found a solution, though it's less than optimal.

ExtFilterDefine phpfilter cmd=/usr/bin/php mode=output
ftype=AP_FTYPE_CONTENT_SET
...
AddHandler cgi-script .cgi
AddOutputFilter phpfilter .cgi

This does indeed give me foobar (at last!), but it's a very inefficient
kludge.

[Aside: I think there's a bug. When you use AddOutputFilter on an external
filter, the filtername will be converted to lowercase. However,
ExtFilterDefine preserves case.]

-- 
Omer Shenker                          http://omershenker.net/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Problems using PHP filters with mod_cgi

Posted by Rich Bowen <rb...@rcbowen.com>.
On Sun, 1 Jun 2003, Omer Shenker wrote:

> On Saturday 31 May 2003 at 21:54 WC -Sx- Jones wrote:
> > You sure you don't get "bar"  --  I mean that should be what
> > is printed
> > IF php was eval'ing like you state...
>
> Yeah, I'm sure. The PHP evals but then the Perl doesn't. Or vice versa,
> depending on the configuration. But I can't get them both to eval for the
> same request--and the Perl needs to eval first anyway.

You don't need the InputFilter, if I understand you correctly. You just
need the AddHandler and the AddOutputFilter. The names mean what they
say, and you are not filtering any input. (Input is what comes in from
the client.) However, I don't expect that this is the source of your
problem. I know that the following works:

AddHandler cgi-script .cgi
AddOutputFilter INCLUDES .cgi

However, I don't have PHP installed right now to test the analogous PHP
configuration.

-- 
Rich Bowen - rbowen@rcbowen.com
... and another brother out of his mind, and another brother out at New
York (not the same, though it might appear so)
	Somebody's Luggage (Charles Dickens)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org