Re: Seg Fault with PHP and Perl together

2002-09-05 Thread Enrico Sorcinelli

On Wed, 04 Sep 2002 18:17:44 +0100
Jon Harris [EMAIL PROTECTED] wrote:

 Hi
 
 I inherited a very happy cobalt raq3 with 2 sites using embedded Perl 
 which work very well. There are about 20 sites on the box. I needed to 
 get PHP running on the same box, so I made the module, added it into the 
 httpd.conf and PHP was working fine - Except that it broke the perl sites.
 
 The http error log entry is:
 child pid 22610 exit signal Segmentation fault (11)
 
 - the client gets a 'page not found error'.
 
 All I have to do get perl working again is to comment out
 
 LoadModule php4_module /usr/lib/apache/libphp4.so
 (and)
 AddModule mod_php4.c
 
 and restart httpd, it works fine again, obviously minus the php
 
 Bearing in mind, I am on about page 3 of O'Reilly's Apache - The 
 definitive Guide does anyone know the simplist way I can get it 
 working? I don't need any sites to use both embperl and php together.
 
 This is a virtual site section in httpd.conf for one of the perl sites 
 (anonymised) there is also a big Perl chunk in the httpd.conf, not 
 sure if that is relevant here.
 
 *
 VirtualHost 0.0.0.0
 ServerName thedomain.com
 ServerAdmin root
 DocumentRoot /home/sites/site42/web
 ServerAlias thedomain.com
 PerlModule Apache::DBI
 PerlModule HTML::Embperl
 PerlSetEnv EMBPERL_OPTIONS 8208
 PerlSetEnv EMBPERL_ESCMODE 0
 RewriteEngine on
 RewriteCond %{HTTP_HOST}!^0.0.0.0(:80)?$
 RewriteCond %{HTTP_HOST}!^www.thedomain.com(:80)?$
 RewriteRule ^/(.*)  http://www.thedomain.com/$1 [L,R]
 RewriteOptions inherit
 #Files *.htm*
 #SetHandler perl-script
 #PerlHandler HTML::Embperl
 #Options ExecCGI
 #/Files
 AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
 AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
 # AddHandler server-parsed .shtml
 # AddTypetext/html .shtml
 AddHandler cgi-wrapper .cgi
 AddHandler cgi-wrapper .pl
 /VirtualHost
 *
 
 It looks like perl and PHP are getting in each others way, should I try 
 and make a new apache? what order should I do things in? Should I look 
 for another job? :), I need to get it working quickly and with the 
 minimum disruption to the server. Every time I try and do things like 
 this on a RAQ something breaks something else, usually its the GUI and I 
 get about 50 phone calls.
 

If you must resolve urgently this problem, you can consider the possibility
to proxy all mod_perl requests to an Apache/mod_perl enabled on a different
port (also this save more memory).

- Enrico







Seg Fault with PHP and Perl together

2002-09-04 Thread Jon Harris

Hi

I inherited a very happy cobalt raq3 with 2 sites using embedded Perl 
which work very well. There are about 20 sites on the box. I needed to 
get PHP running on the same box, so I made the module, added it into the 
httpd.conf and PHP was working fine - Except that it broke the perl sites.

The http error log entry is:
child pid 22610 exit signal Segmentation fault (11)

- the client gets a 'page not found error'.

All I have to do get perl working again is to comment out

LoadModule php4_module /usr/lib/apache/libphp4.so
(and)
AddModule mod_php4.c

and restart httpd, it works fine again, obviously minus the php

Bearing in mind, I am on about page 3 of O'Reilly's Apache - The 
definitive Guide does anyone know the simplist way I can get it 
working? I don't need any sites to use both embperl and php together.

This is a virtual site section in httpd.conf for one of the perl sites 
(anonymised) there is also a big Perl chunk in the httpd.conf, not 
sure if that is relevant here.

*
VirtualHost 0.0.0.0
ServerName thedomain.com
ServerAdmin root
DocumentRoot /home/sites/site42/web
ServerAlias thedomain.com
PerlModule Apache::DBI
PerlModule HTML::Embperl
PerlSetEnv EMBPERL_OPTIONS 8208
PerlSetEnv EMBPERL_ESCMODE 0
RewriteEngine on
RewriteCond %{HTTP_HOST}!^0.0.0.0(:80)?$
RewriteCond %{HTTP_HOST}!^www.thedomain.com(:80)?$
RewriteRule ^/(.*)  http://www.thedomain.com/$1 [L,R]
RewriteOptions inherit
#Files *.htm*
#SetHandler perl-script
#PerlHandler HTML::Embperl
#Options ExecCGI
#/Files
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
# AddHandler server-parsed .shtml
# AddTypetext/html .shtml
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
/VirtualHost
*

It looks like perl and PHP are getting in each others way, should I try 
and make a new apache? what order should I do things in? Should I look 
for another job? :), I need to get it working quickly and with the 
minimum disruption to the server. Every time I try and do things like 
this on a RAQ something breaks something else, usually its the GUI and I 
get about 50 phone calls.

perl is version 5.005_03, Apache 1.3, PHP 4.21

TIA

Jon Harris
[EMAIL PROTECTED]







Re: Seg Fault with PHP and Perl together

2002-09-04 Thread wsheldah



Check the mail archives for this list, there was a thread about using perl and
php together not that long ago. I think that one suggestion was to compile
mod_perl statically with apache, and to load php as a module. Also, you may want
to upgrade your perl to at least 5.6.1, if not 5.8.0. Are you using apache
1.3.26? (anything older has a well-known security exploit). What version of
mod_perl?

Wes



Jon Harris [EMAIL PROTECTED] on 09/04/2002
01:17:44 PM

To:   [EMAIL PROTECTED]
cc:(bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  Seg Fault with PHP and Perl together



Hi

I inherited a very happy cobalt raq3 with 2 sites using embedded Perl
which work very well. There are about 20 sites on the box. I needed to
get PHP running on the same box, so I made the module, added it into the
httpd.conf and PHP was working fine - Except that it broke the perl sites.

The http error log entry is:
child pid 22610 exit signal Segmentation fault (11)

- the client gets a 'page not found error'.

All I have to do get perl working again is to comment out

LoadModule php4_module /usr/lib/apache/libphp4.so
(and)
AddModule mod_php4.c

and restart httpd, it works fine again, obviously minus the php

Bearing in mind, I am on about page 3 of O'Reilly's Apache - The
definitive Guide does anyone know the simplist way I can get it
working? I don't need any sites to use both embperl and php together.

This is a virtual site section in httpd.conf for one of the perl sites
(anonymised) there is also a big Perl chunk in the httpd.conf, not
sure if that is relevant here.

*
VirtualHost 0.0.0.0
ServerName thedomain.com
ServerAdmin root
DocumentRoot /home/sites/site42/web
ServerAlias thedomain.com
PerlModule Apache::DBI
PerlModule HTML::Embperl
PerlSetEnv EMBPERL_OPTIONS 8208
PerlSetEnv EMBPERL_ESCMODE 0
RewriteEngine on
RewriteCond %{HTTP_HOST}!^0.0.0.0(:80)?$
RewriteCond %{HTTP_HOST}!^www.thedomain.com(:80)?$
RewriteRule ^/(.*)  http://www.thedomain.com/$1 [L,R]
RewriteOptions inherit
#Files *.htm*
#SetHandler perl-script
#PerlHandler HTML::Embperl
#Options ExecCGI
#/Files
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site42/users/$1/web/$3
# AddHandler server-parsed .shtml
# AddTypetext/html .shtml
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
/VirtualHost
*

It looks like perl and PHP are getting in each others way, should I try
and make a new apache? what order should I do things in? Should I look
for another job? :), I need to get it working quickly and with the
minimum disruption to the server. Every time I try and do things like
this on a RAQ something breaks something else, usually its the GUI and I
get about 50 phone calls.

perl is version 5.005_03, Apache 1.3, PHP 4.21

TIA

Jon Harris
[EMAIL PROTECTED]











Re: Seg Fault with PHP and Perl together

2002-09-04 Thread WC -Sx- Jones


# mod_perl -
perl Makefile.PL \
USE_APXS=1 \
WITH_APXS=/usr/local/apache/bin/apxs \
EVERYTHING=1 \
USE_DSO=1

# PHP -
./configure --with-apxs=/usr/local/apache/bin/apxs \
  --enable-force-cgi-redirect \
  --enable-discard-path \
  --with-pear \
  --enable-safe-mode \
  --with-openssl \
  --enable-bcmath \
  --with-bz2 \
  --with-gdbm \
  --with-ndbm \
  --enable-dio \
  --enable-ftp \
  --with-ldap \
  --with-mysql=/usr/local/ \
  --with-pgsql \
  --enable-memory-limit

???/Sx ?



Re: Seg Fault with PHP and Perl together

2002-09-04 Thread Ged Haywood

Hi there,

On Wed, 4 Sep 2002, Jon Harris wrote:

 I inherited a very happy cobalt raq3 with 2 sites using embedded Perl 
 which work very well. There are about 20 sites on the box. I needed to 
 get PHP running on the same box, so I made the module, added it into the 
 httpd.conf and PHP was working fine - Except that it broke the perl sites.

( Disclaimer: I don't use PHP. :)

Check out the mod_perl List archives, a number of people are doing
this kind of thing and there was a thread very recently about it.

You may perhaps find you need to compile a new Apache (static linking
instead of DSO), but it's no big deal.  But I'd first check those
archives, and maybe make sure that I'd used the same compiler for the
PHP module build as was used for Apache and mod_perl.  It's worth
checking the options used as well, things like large file support
can cause problems if they're not the same for each build.

I don't know if there are any issues with the versions of the various
bits of software you're using, there might be.  Perl 5.005 is getting
a little long in the tooth now, and you didn't say which Apache 1.3
you have, there are lots of them...

I wouldn't expect the problem to be related to EmbPerl but you never
know.  There's an EmbPerl site, check out the mod_perl home page for
the address, but Gerald Richter reads the posts here too.

And yes, it sometimes does matter what order you do things in - you
might find that the order of loading modules is important - but I
don't know of any particular problem with the modules you mentioned.
You could make a completely new Apache just to test things and run it
as a separate server, not listening to port 80 but to some other port.
There are lots of useful pointers to doing things like this in the
Guide, the mod_perl home page will lead you there too.

73,
Ged.