getting php and mod_perl to work together.

getting php and mod_perl to work together.

Post by Joshua Sliv » Sun, 14 Feb 1999 04:00:00




>    Basically, it comes down to five questions.
>    1) Can I compile apache with mod_perl and php?
Yes.
>    2) How exactly do apache modules communicate (named pipes, IPC, etc.)?

I'm not sure what you mean.  They communicate with the client through
the apache API.
Quote:>    3) Can one modules use another modules (e.g. php calling an apache::*
> module of some sort)?  If not, can both modules co-exist harmoniously by
> ignoring each other?

No, you can't chain content filters if that is what you mean. Yes they
can simply ignore each other.
Quote:>    4) Has anyone done this before?
Yes.
>    5) Is there any reason why I wouldn't want to use the two together?

It will make for a very big binary.

--
Joshua Slive

http://finance.commerce.ubc.ca/~slive/

 
 
 

getting php and mod_perl to work together.

Post by Rasmus Lerdo » Sun, 14 Feb 1999 04:00:00


Quote:>    Basically, it comes down to five questions.
>    1) Can I compile apache with mod_perl and php?

Yup, no problem.  They are completely independent of each other.

Quote:>    2) How exactly do apache modules communicate (named pipes, IPC, etc.)?

Communicate with what?  The server?  Each other?  There are no named
pipes or IPC or anything else.  mod_perl and PHP are both compiled
directly into the web server (although both will obviously run as CGI's
as well) and since they are in the same process space they can call
Apache API functions directly.  

Quote:>    3) Can one modules use another modules (e.g. php calling an apache::*
> module of some sort)?  If not, can both modules co-exist harmoniously by
> ignoring each other?

No, there are no provisions for sharing functionality like this.  
Theoretically speaking, one could write a Perl module that lets you call
PHP functions from mod_perl and vice versa.  Nobody has done it and there
hasn't really been any demand for this.  mod_perl and PHP appeal to
different types of people.  

Quote:>    4) Has anyone done this before?

Sure.

Quote:>    5) Is there any reason why I wouldn't want to use the two together?

Not really.  Your server binary might end up being rather large, but that
is also rather irrelevant assuming you aren't already borderline in terms
of memory usage.

-Rasmus

 
 
 

1. mod_perl 1.16 and php 3.0.5 together crashes Apache 1.3.3

Hi

I have tried to configure Apache 1.3.3 with both mod_perl 1.16 and php
3.0.5, and it compiles ok, but when I run my old perl scripts, apache
dies on a sigsegv.  The same apache, only compiled without php, works
well, very well.  My scripts use mod_perl, I don't even touch php.

If I try some of the small examples from the PHP distribution, they run
ok, but mod_perl dies as soon as I touch it.

The crash seems to happen in the beginning of my perl scripts, but I
haven't been able to pinpoint it better (I used strace).

I guess it is some kind of conflict, unless I have botched the
configuration, but everything compiled smoothly. I have configured,
compiled and installed as described in README.configure from the apache
source.  First PHP, then mod_perl (I have tried it the other way around
too), then apache.

I use CGI.pm 2.42 which I preload from the startup perl script.  It has
served me well for some time.

Right now I have skipped php, as I depend on mod_perl.  I had looked
forward to playing with php, though.

This in on Linux 2.0.34, Slackware 3.5, libc5, egcs 2.90.29 980515
(egcs-1.0.3 release).  Php was linked with mysql 3.22.11, but that
wasn't used.

Any kind of help is appreciated, and if I can be of any help with
traces, code examples, core dumps, whatever, I will help.

--

2. Join the movement to get PC OEMs to put Java on Windows XP

3. Any one got apache + mod_perl + php + Embperl + DBI.pm to work???

4. Q on ipchains

5. Getting MOD_Perl to work in windows/nt

6. Announce: Open Motif 2.2 - Major Upgrade

7. getting mod_perl to work properly

8. Help! Problem with add_drv command

9. Getting pmfirewall,rp-pppoe and squid to work together

10. Problems getting IBM TokenRing and EtherWorks3 working together

11. Getting XFree86 and CDE to work together

12. Getting news and mail to work together

13. Getting two wireless AP's to work together for laptop and linux workstation