[Xitami] PHP/perl as non-CGI

Marcio Marchini xitami@lists.xitami.org
Thu, 6 Dec 2001 10:28:10 -0500


	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
>