You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <st...@stason.org> on 2003/08/08 02:30:07 UTC

Re: http responses piped to STDERR

Michael Pohl wrote:
> I'm (very) occasionally seeing the output of Apache::Registry scripts sent
> to STDERR instead of STDOUT.  That is, the entire http response (headers
> included) appears in my error log, while nothing at all is displayed to
> the client.
> 
> Could someone kick me towards what I should look into here?

Do you have this stub in all your files?

use strict;
use warnings;

or if perl < 5.6

PerlWarn On
   in httpd.conf and
use strict;
   in all files.

this should reduce the numbed of inconsistent misteries to zero.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Threading issue in 5.6 and 5.8

Posted by Mustafa Tan <mu...@yahoo.com>.
Hi Stas,
here is the google groups page that defines the
problem.

http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&threadm=7j14it%248v1%241%40zonnetje.NL.net&rnum=1&prev=/groups%3Fnum%3D100%26hl%3Den%26lr%3Dlang_en%26ie%3DISO-8859-1%26q%3DIO%253A%253ASocket%253A%253AINET%2Bmod_perl%2BWindows%2BNT%26sa%3DN%26tab%3Dwg

Basically it says the following:

Hello.

I'm having a problem with IO::Socket::INET using
Apache mod_perl. I'm using
ModPerl 1.19,
Perl 5.005_03 and Apache 1.3.6 on my NT system.  I've
included a small
sample program below that demonstrates the behaviour.
The basic problem I am having is as follows:
    The first time I get the page it works correctly.
    However, if I reload the page, no output is
returned.
    But, by pressing reload repeatedly, I noticed that
every 5 times, it
works correctly.
    As if refusing to return anything wasn't bad
enough, no error is given.
Any suggestions would be greatly appreciated.

Thanks,

Mark.

Here is the possible solution, which actually works:

I actually just found the problem this morning.  It
was a server problem.
An NT thing I guess.  I changed the ThreadsPerChild
setting to 1 in my
httpd.conf file.
The problem disappeared right away.


--- Stas Bekman <st...@stason.org> wrote:
> Ged Haywood wrote:
> > Hi there,
> > 
> > On Thu, 7 Aug 2003, Mustafa Tan wrote:
> > 
> > 
> >>script's name is A, and I execute the same script
> 20
> >>times subsequently there is no problem. But if I
> >>execute B after A, and then execute A again, then
> I
> >>have a problem and the problem is that there is a
> >>socket error. This happens only on Windows
> machines. I
> >>learnt that this is a common problem and that it
> is
> >>because of threads. Making number of threads on
> apache
> >>1 solves the problem
> 
> I doubt this has anything to do with threads,
> because they are serialized in 
> mod_perl 1.0  on windows. Do you use mod_perl 2.0?
> 
> Most likely your problem is the usual one: global
> variables persist under 
> mod_perl and you have to reset them before using.
> For more information see:
>
http://perl.apache.org/docs/1.0/guide/porting.html#Global_Variables_Persistence
> 
> In any case when reporting problems you should at
> least copy-n-paste the exact 
> error. And follow the guidelines:
> mp1:
>
http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems
> mp2:
>
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
> 
> > Sorry I know prcatically nothing about running
> Apache on Windows.
> > Seems strange to me that anyone would do it... :)
> 
> This is correct for mod_perl 1.0, because threads
> are serialized to make 
> things thread-safe.
> 
> But this is no longer valid for mod_perl 2.0.
> mod_perl 2.0 on windows should 
> be "as good as" on any other system.
> 
> >>Ok, here is the real question. Should I move to
> 5.8
> >>and if I should, what are the general issues that
> I
> >>have to be careful about. One more thing is that,
> can
> >>I run perl 5.8 with mod_perl 1.0? Is that
> possible, or
> >>do I also have to move to mod_perl 2 and apache 2?
> > 
> > 
> > You can run 5.8.x with mod_perl 1.x, the issue you
> will most likely
> > meet involves character encoding.  Check the
> archives of this List
> > for more information.  Look for "UTF-8" and/or
> "locale".
> 
> This is correct only for several RedHat linux
> versions. it should be fixed in 
> RH9.1:
>
http://archive.develooper.com/perl5-porters@perl.org/msg97360.html
> 
> > Version 2 of Apache/mod_perl might enable you to
> address some of your
> > threading problems on Windows, hopefully others
> will be able to tell
> > you more than I can.
> > 
> > 73,
> > Ged.
> 
> 
> -- 
> 
> 
>
__________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another
> mod_perl Hacker
> http://stason.org/     mod_perl Guide --->
> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org
> http://apacheweek.com
> http://modperlbook.org http://apache.org  
> http://ticketmaster.com
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: Threading issue in 5.6 and 5.8

Posted by Stas Bekman <st...@stason.org>.
Ged Haywood wrote:
> Hi there,
> 
> On Thu, 7 Aug 2003, Mustafa Tan wrote:
> 
> 
>>script's name is A, and I execute the same script 20
>>times subsequently there is no problem. But if I
>>execute B after A, and then execute A again, then I
>>have a problem and the problem is that there is a
>>socket error. This happens only on Windows machines. I
>>learnt that this is a common problem and that it is
>>because of threads. Making number of threads on apache
>>1 solves the problem

I doubt this has anything to do with threads, because they are serialized in 
mod_perl 1.0  on windows. Do you use mod_perl 2.0?

Most likely your problem is the usual one: global variables persist under 
mod_perl and you have to reset them before using. For more information see:
http://perl.apache.org/docs/1.0/guide/porting.html#Global_Variables_Persistence

In any case when reporting problems you should at least copy-n-paste the exact 
error. And follow the guidelines:
mp1: http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems
mp2: http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

> Sorry I know prcatically nothing about running Apache on Windows.
> Seems strange to me that anyone would do it... :)

This is correct for mod_perl 1.0, because threads are serialized to make 
things thread-safe.

But this is no longer valid for mod_perl 2.0. mod_perl 2.0 on windows should 
be "as good as" on any other system.

>>Ok, here is the real question. Should I move to 5.8
>>and if I should, what are the general issues that I
>>have to be careful about. One more thing is that, can
>>I run perl 5.8 with mod_perl 1.0? Is that possible, or
>>do I also have to move to mod_perl 2 and apache 2?
> 
> 
> You can run 5.8.x with mod_perl 1.x, the issue you will most likely
> meet involves character encoding.  Check the archives of this List
> for more information.  Look for "UTF-8" and/or "locale".

This is correct only for several RedHat linux versions. it should be fixed in 
RH9.1:
http://archive.develooper.com/perl5-porters@perl.org/msg97360.html

> Version 2 of Apache/mod_perl might enable you to address some of your
> threading problems on Windows, hopefully others will be able to tell
> you more than I can.
> 
> 73,
> Ged.


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Threading issue in 5.6 and 5.8

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Thu, 7 Aug 2003, Mustafa Tan wrote:

> script's name is A, and I execute the same script 20
> times subsequently there is no problem. But if I
> execute B after A, and then execute A again, then I
> have a problem and the problem is that there is a
> socket error. This happens only on Windows machines. I
> learnt that this is a common problem and that it is
> because of threads. Making number of threads on apache
> 1 solves the problem

Sorry I know prcatically nothing about running Apache on Windows.
Seems strange to me that anyone would do it... :)

> Ok, here is the real question. Should I move to 5.8
> and if I should, what are the general issues that I
> have to be careful about. One more thing is that, can
> I run perl 5.8 with mod_perl 1.0? Is that possible, or
> do I also have to move to mod_perl 2 and apache 2?

You can run 5.8.x with mod_perl 1.x, the issue you will most likely
meet involves character encoding.  Check the archives of this List
for more information.  Look for "UTF-8" and/or "locale".

Version 2 of Apache/mod_perl might enable you to address some of your
threading problems on Windows, hopefully others will be able to tell
you more than I can.

73,
Ged.


Threading issue in 5.6 and 5.8

Posted by Mustafa Tan <mu...@yahoo.com>.
Hi everybody,
I have a simple script that uses POP3Client to
retrieve emails. It turns out that I can run this
script only once, or more if all the subsequent
requests are to the same script. That is say, my
script's name is A, and I execute the same script 20
times subsequently there is no problem. But if I
execute B after A, and then execute A again, then I
have a problem and the problem is that there is a
socket error. This happens only on Windows machines. I
learnt that this is a common problem and that it is
because of threads. Making number of threads on apache
1 solves the problem, but then a refresh is extremely
slow, cause it seems KeepAlive makes the thread stop
responding to the refresh until keep alive times out. 

Ok, here is the real question. Should I move to 5.8
and if I should, what are the general issues that I
have to be careful about. One more thing is that, can
I run perl 5.8 with mod_perl 1.0? Is that possible, or
do I also have to move to mod_perl 2 and apache 2?

Thanks

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com