[Xitami] PHP/perl as non-CGI

Marcio Marchini xitami@lists.xitami.org
Thu, 6 Dec 2001 11:52:48 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0011_01C17E4C.86BA86F0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit



        BTW, there's a PHP download which automatically configures Xitami.
It has a wizard that does it all. It's the MSI download for PHP, not the zip
version. The problem with that is that it does not come with all the
extensions compiled in. You may not care, though.

        Also, the way you are doing seems to be regular CGI, not ISAPI. For
ISAPI you tell the web server which DLL to load. When you point to the EXE,
it's usually non-ISAPI, but regular CGI.  See
http://www.dynamic-webpages.de/php/install.iis.php

----- cut here ------

If you choose the CGI binary, do the following:
Edit the enclosed pws-php4cgi.reg file (look into the sapi dir) to reflect
the location of your php.exe. Forward slashes should be escaped, for
example:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Scrip
t Map] ".php"="c:\\php\\php.exe"


If you choose the ISAPI module, do the following:
Edit the enclosed pws-php4isapi.reg file (look into the sapi dir) to reflect
the location of your php4isapi.dll. Forward slashes should be escaped, for
example:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Scrip
t Map] ".php"="c:\\php\\sapi\\php4isapi.dll"

----- cut here ------

    Again, I am not sure Xitami supports ISAPI.

marcio

> -----Original Message-----
> From: xitami-admin@lists.xitami.org
> [mailto:xitami-admin@lists.xitami.org]On Behalf Of Peter
> Sent: December 6, 2001 11:09 AM
> To: xitami@lists.xitami.org
> Subject: Re: [Xitami] PHP/perl as non-CGI
>
>
> I've spent the morning trying to get php running as ISAPI without
> any luck.
> It sure looks like it should work the set-up is very similar to another
> server I use. I don't seem to be getting any errors Xitami is
> servering the
> test page but it is not processing the script.
>
> The FAQ says:
>   1.. First off, make sure Xitami is installed and running.
>   2.. Next, download and install the PHP binary distribution into some
> directory. We'll assume it's c:\php.
>   3.. Add '.php=c:\php\php.exe' to the Filter section of the Xitami
> confguration.
>   4.. Rename the PHP initialisation file, 'php3.ini-dist' to
> 'php3.ini' and
> copy it into the Windows directory. Don't bother trying to set the PHPRC
> environment variable, because this does not seem to work.
>   5.. Edit the ini file and change the 'extension_dir' setting to c:\php.
>   6.. Now test PHP by hand with a small test page, by running it in a
> command window, in the Xitami directory:
> c:\php\php webpages\test.php
>
>
> ----- Original Message -----
> From: "Marcio Marchini" <mqm@magma.ca>
> To: <xitami@lists.xitami.org>
> Sent: Thursday, December 06, 2001 10:28 AM
> Subject: RE: [Xitami] PHP/perl as non-CGI
>
>
> >
> > As far as I know Xitami has LRWP, not FastCGI. LRWP is not
> FastCGI, but it
> > is very similar. "The protocol between Xitami and the LRWP Peer is much
> > simpler than the FastCGI protocol, and therefore less prone to
> > implementation differences or errors. However, given the right
> circumstances
> > it is possible to run the same program as both a LRWP Peer and a FastCGI
> > Peer with only minor differences in the startup code. "
> >
> >
> > So, you'd have to write your own C adapter to be a LRWP/FastCGI server &
> > link to the PHP/Perl interpreter.
> >
> > What I've seen in PHP (and probably Perl) under Win32 is that
> they support
> > the Microsoft way of doing things (ISAPI or something like
> that), which I
> > don't think Xitami supports ? Anyway, under PWS (Personal Web
> Server) and
> > IIS you can probably enable them in this faster mode (ISAPI).
> >
> >
> > Again, maybe by now Xitami supports ISAPI, but I don't think so. I think
> > they don't because they want to be OS-portable, and ISAPI would be
> > Windows-specific. I could be wrong.
> >
> > Zope (www.zope.org) has a regular, thin CGI which then talks to
> Zope on a
> > specific port. So, if you configure Zope behind Apache, you use this
> > small&fast CGI which gets loaded/unloaded for every request, but it is
> > fast/small. It then opens a connection to Zope on a given
> socket, and they
> > exchange data, and the little CGI passes the bytes back to
> Apache. This is
> > another option, but you'd have to write the little CGI yourself
> and leave
> > the PHP or Perl interpreter running, listening for requests on a port
> (like
> > a Java servlet engine, etc). The advantage of this compared to an apache
> MOD
> > is that it is portable across web servers. You can run Zope
> behind any web
> > server just by porting this tiny CGI to the new platform. LRWP, on the
> other
> > ahnd, is Xitami-specific. MODs are Apache-specific. ISAPI is
> > Windows-specific. The Zope solution is very portable with a small
> > performance penalty (lightweight CGI + sockets). There's no
> ideal solution
> > :-)
> >
> > But Zope is designed to be a server & listen on a port, while
> the PHP/Perl
> > interpreters aren't. That's why they need more work, like a C code that
> > links to teh interpreter & does the glue work. It would be nice
> if Xitami
> > supported ISAPI.
> >
> > Sorry I don't have good news. Hope this helps a bit. Note that I may be
> > wrong in some points, it's been a while since I looked into this.
> >
> > marcio
> >
> >
> > > -----Original Message-----
> > > From: xitami-admin@lists.xitami.org
> > > [mailto:xitami-admin@lists.xitami.org]On Behalf Of Vardhan Varma
> > > Sent: December 5, 2001 11:04 PM
> > > To: 'xitami@lists.xitami.org'
> > > Subject: [Xitami] PHP/perl as non-CGI
> > >
> > >
> > >
> > >  Hi,
> > >   I've searched the archive, and while the question of PHP and PERL
> > > as non-CGI (fastcgi/WSX etc and not seperate process executed
> everytime)
> > > has been raised many time, there has
> > > been no post telling 'yes i've done it and here is the url'.
> > >
> > > Does anybody has PHP/perl running as non-CGI in Xitami ?
> > > If yes, are they willing to share the patch .
> > >
> > >
> > > --Thanx
> > > --Vardhan
> > >
> > > --
> > > Xitami Users Mailing List -- For Xitami support
> > > To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
> > >
> >
> >
> > --
> > Xitami Users Mailing List -- For Xitami support
> > To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
> >
> >
>
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>


------=_NextPart_000_0011_01C17E4C.86BA86F0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR></HEAD>
<BODY><FONT face=3DArial color=3D#0000ff size=3D2></FONT><BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=3D2>BTW, =
there's a PHP=20
download which automatically configures Xitami. It has a wizard that =
does it=20
all. It's the MSI download for PHP, not the zip version. The problem =
with that=20
is that it does not come with all the extensions compiled in. You may =
not care,=20
though.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Also, the way =
you are=20
doing seems to be regular CGI, not ISAPI. For ISAPI you tell the web =
server=20
which DLL to load. When you point to the EXE, it's usually non-ISAPI, =
but=20
regular CGI.&nbsp; See <A=20
href=3D"http://www.dynamic-webpages.de/php/install.iis.php"=20
target=3D_blank>http://www.dynamic-webpages.de/php/install.iis.php</A></F=
ONT></P>
<P><FONT size=3D2>----- cut here ------<BR><BR>If you choose the <FONT=20
color=3D#ff0000>CGI</FONT> binary, do the following:<BR>Edit the =
enclosed=20
pws-php4cgi.reg file (look into the sapi dir) to reflect the location of =
your=20
php.exe. Forward slashes should be escaped, for example:=20
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Sc=
ript=20
Map] ".php"=3D"c:\\php\\<FONT =
color=3D#ff0000>php.exe</FONT>"<BR><BR><BR>If you=20
choose the <FONT color=3D#ff0000>ISAPI</FONT> module, do the =
following:<BR>Edit=20
the enclosed pws-php4isapi.reg file (look into the sapi dir) to reflect =
the=20
location of your php4isapi.dll. Forward slashes should be escaped, for =
example:=20
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Sc=
ript=20
Map] ".php"=3D"c:\\php\\sapi\\<FONT=20
color=3D#ff0000>php4isapi.dll</FONT>"<BR><BR>----- cut here =
------</FONT></P>
<P><FONT size=3D2>&nbsp;&nbsp;&nbsp; Again, I am not sure Xitami =
supports=20
ISAPI.<BR><BR>marcio<BR><BR>&gt; -----Original Message-----<BR>&gt; =
From:=20
xitami-admin@lists.xitami.org<BR>&gt; [<A=20
href=3D"mailto:xitami-admin@lists.xitami.org"=20
target=3D_blank>mailto:xitami-admin@lists.xitami.org</A>]On Behalf Of=20
Peter<BR>&gt; Sent: December 6, 2001 11:09 AM<BR>&gt; To:=20
xitami@lists.xitami.org<BR>&gt; Subject: Re: [Xitami] PHP/perl as=20
non-CGI<BR>&gt;<BR>&gt;<BR>&gt; I've spent the morning trying to get php =
running=20
as ISAPI without<BR>&gt; any luck.<BR>&gt; It sure looks like it should =
work the=20
set-up is very similar to another<BR>&gt; server I use. I don't seem to =
be=20
getting any errors Xitami is<BR>&gt; servering the<BR>&gt; test page but =
it is=20
not processing the script.<BR>&gt;<BR>&gt; The FAQ =
says:<BR>&gt;&nbsp;&nbsp; 1..=20
First off, make sure Xitami is installed and =
running.<BR>&gt;&nbsp;&nbsp; 2..=20
Next, download and install the PHP binary distribution into some<BR>&gt; =

directory. We'll assume it's c:\php.<BR>&gt;&nbsp;&nbsp; 3.. Add=20
'.php=3Dc:\php\php.exe' to the Filter section of the Xitami<BR>&gt;=20
confguration.<BR>&gt;&nbsp;&nbsp; 4.. Rename the PHP initialisation =
file,=20
'php3.ini-dist' to<BR>&gt; 'php3.ini' and<BR>&gt; copy it into the =
Windows=20
directory. Don't bother trying to set the PHPRC<BR>&gt; environment =
variable,=20
because this does not seem to work.<BR>&gt;&nbsp;&nbsp; 5.. Edit the ini =
file=20
and change the 'extension_dir' setting to c:\php.<BR>&gt;&nbsp;&nbsp; =
6.. Now=20
test PHP by hand with a small test page, by running it in a<BR>&gt; =
command=20
window, in the Xitami directory:<BR>&gt; c:\php\php=20
webpages\test.php<BR>&gt;<BR>&gt;<BR>&gt; ----- Original Message =
-----<BR>&gt;=20
From: "Marcio Marchini" &lt;mqm@magma.ca&gt;<BR>&gt; To:=20
&lt;xitami@lists.xitami.org&gt;<BR>&gt; Sent: Thursday, December 06, =
2001 10:28=20
AM<BR>&gt; Subject: RE: [Xitami] PHP/perl as =
non-CGI<BR>&gt;<BR>&gt;<BR>&gt;=20
&gt;<BR>&gt; &gt; As far as I know Xitami has LRWP, not FastCGI. LRWP is =

not<BR>&gt; FastCGI, but it<BR>&gt; &gt; is very similar. "The protocol =
between=20
Xitami and the LRWP Peer is much<BR>&gt; &gt; simpler than the FastCGI =
protocol,=20
and therefore less prone to<BR>&gt; &gt; implementation differences or =
errors.=20
However, given the right<BR>&gt; circumstances<BR>&gt; &gt; it is =
possible to=20
run the same program as both a LRWP Peer and a FastCGI<BR>&gt; &gt; Peer =
with=20
only minor differences in the startup code. "<BR>&gt; &gt;<BR>&gt; =
&gt;<BR>&gt;=20
&gt; So, you'd have to write your own C adapter to be a LRWP/FastCGI =
server=20
&amp;<BR>&gt; &gt; link to the PHP/Perl interpreter.<BR>&gt; =
&gt;<BR>&gt; &gt;=20
What I've seen in PHP (and probably Perl) under Win32 is that<BR>&gt; =
they=20
support<BR>&gt; &gt; the Microsoft way of doing things (ISAPI or =
something=20
like<BR>&gt; that), which I<BR>&gt; &gt; don't think Xitami supports ? =
Anyway,=20
under PWS (Personal Web<BR>&gt; Server) and<BR>&gt; &gt; IIS you can =
probably=20
enable them in this faster mode (ISAPI).<BR>&gt; &gt;<BR>&gt; =
&gt;<BR>&gt; &gt;=20
Again, maybe by now Xitami supports ISAPI, but I don't think so. I =
think<BR>&gt;=20
&gt; they don't because they want to be OS-portable, and ISAPI would =
be<BR>&gt;=20
&gt; Windows-specific. I could be wrong.<BR>&gt; &gt;<BR>&gt; &gt; Zope=20
(www.zope.org) has a regular, thin CGI which then talks to<BR>&gt; Zope =
on=20
a<BR>&gt; &gt; specific port. So, if you configure Zope behind Apache, =
you use=20
this<BR>&gt; &gt; small&amp;fast CGI which gets loaded/unloaded for =
every=20
request, but it is<BR>&gt; &gt; fast/small. It then opens a connection =
to Zope=20
on a given<BR>&gt; socket, and they<BR>&gt; &gt; exchange data, and the =
little=20
CGI passes the bytes back to<BR>&gt; Apache. This is<BR>&gt; &gt; =
another=20
option, but you'd have to write the little CGI yourself<BR>&gt; and=20
leave<BR>&gt; &gt; the PHP or Perl interpreter running, listening for =
requests=20
on a port<BR>&gt; (like<BR>&gt; &gt; a Java servlet engine, etc). The =
advantage=20
of this compared to an apache<BR>&gt; MOD<BR>&gt; &gt; is that it is =
portable=20
across web servers. You can run Zope<BR>&gt; behind any web<BR>&gt; &gt; =
server=20
just by porting this tiny CGI to the new platform. LRWP, on the<BR>&gt;=20
other<BR>&gt; &gt; ahnd, is Xitami-specific. MODs are Apache-specific. =
ISAPI=20
is<BR>&gt; &gt; Windows-specific. The Zope solution is very portable =
with a=20
small<BR>&gt; &gt; performance penalty (lightweight CGI + sockets). =
There's=20
no<BR>&gt; ideal solution<BR>&gt; &gt; :-)<BR>&gt; &gt;<BR>&gt; &gt; But =
Zope is=20
designed to be a server &amp; listen on a port, while<BR>&gt; the=20
PHP/Perl<BR>&gt; &gt; interpreters aren't. That's why they need more =
work, like=20
a C code that<BR>&gt; &gt; links to teh interpreter &amp; does the glue =
work. It=20
would be nice<BR>&gt; if Xitami<BR>&gt; &gt; supported ISAPI.<BR>&gt;=20
&gt;<BR>&gt; &gt; Sorry I don't have good news. Hope this helps a bit. =
Note that=20
I may be<BR>&gt; &gt; wrong in some points, it's been a while since I =
looked=20
into this.<BR>&gt; &gt;<BR>&gt; &gt; marcio<BR>&gt; &gt;<BR>&gt; =
&gt;<BR>&gt;=20
&gt; &gt; -----Original Message-----<BR>&gt; &gt; &gt; From:=20
xitami-admin@lists.xitami.org<BR>&gt; &gt; &gt; [<A=20
href=3D"mailto:xitami-admin@lists.xitami.org"=20
target=3D_blank>mailto:xitami-admin@lists.xitami.org</A>]On Behalf Of =
Vardhan=20
Varma<BR>&gt; &gt; &gt; Sent: December 5, 2001 11:04 PM<BR>&gt; &gt; =
&gt; To:=20
'xitami@lists.xitami.org'<BR>&gt; &gt; &gt; Subject: [Xitami] PHP/perl =
as=20
non-CGI<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; =
&gt;=20
&gt;&nbsp; Hi,<BR>&gt; &gt; &gt;&nbsp;&nbsp; I've searched the archive, =
and=20
while the question of PHP and PERL<BR>&gt; &gt; &gt; as non-CGI =
(fastcgi/WSX etc=20
and not seperate process executed<BR>&gt; everytime)<BR>&gt; &gt; &gt; =
has been=20
raised many time, there has<BR>&gt; &gt; &gt; been no post telling 'yes =
i've=20
done it and here is the url'.<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Does =
anybody=20
has PHP/perl running as non-CGI in Xitami ?<BR>&gt; &gt; &gt; If yes, =
are they=20
willing to share the patch .<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; =
&gt;=20
&gt; --Thanx<BR>&gt; &gt; &gt; --Vardhan<BR>&gt; &gt; &gt;<BR>&gt; &gt; =
&gt;=20
--<BR>&gt; &gt; &gt; Xitami Users Mailing List -- For Xitami =
support<BR>&gt;=20
&gt; &gt; To unsubscribe: <A=20
href=3D"http://lists.xitami.org/mailman/listinfo/xitami"=20
target=3D_blank>http://lists.xitami.org/mailman/listinfo/xitami</A><BR>&g=
t; &gt;=20
&gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; --<BR>&gt; &gt; Xitami Users =
Mailing=20
List -- For Xitami support<BR>&gt; &gt; To unsubscribe: <A=20
href=3D"http://lists.xitami.org/mailman/listinfo/xitami"=20
target=3D_blank>http://lists.xitami.org/mailman/listinfo/xitami</A><BR>&g=
t;=20
&gt;<BR>&gt; &gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; --<BR>&gt; Xitami =
Users=20
Mailing List -- For Xitami support<BR>&gt; To unsubscribe: <A=20
href=3D"http://lists.xitami.org/mailman/listinfo/xitami"=20
target=3D_blank>http://lists.xitami.org/mailman/listinfo/xitami</A><BR>&g=
t;=20
</FONT></P></BODY></HTML>

------=_NextPart_000_0011_01C17E4C.86BA86F0--