Re: Apache::Reload and INC path partialy working

2003-08-14 Thread Bruce Tennant
Ugh! Not use to lists that reply to author.

Okay to resay what I sent to Geoffrey.

using the -I switch in the config file works, unlike the PerlSetEnv PERL5LIBGeoffrey Young [EMAIL PROTECTED] wrote:

 Here's my perl.conf (sourced by httpd.conf) start LoadModule perl_module modules/mod_perl.so PerlSetEnv PERL5LIB /home/bruce/public_html/ffball/myffon second thought, tryPerlSwitches -I/home/bruce/public_html/ffball/myfforPerlSwitches -Mlib=/home/bruce/public_html/ffball/myffinstead of PERL5LIB--Geoffwww.bluewolverine.com
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Apache::Reload and INC path partialy working

2003-08-14 Thread Bruce Tennant

I'm trying to do some development work with mod_perl and find restarting the server a pain. So I setup Apache::Reload, but it doesn't seem to want to see my local devel directory all the time.Here's my settingsApache/2.0.40mod_perl-1.99_7Linux 2.4.20-8 (RedHat9 I think)Here's my perl.conf (sourced by httpd.conf)startLoadModule perl_module modules/mod_perl.soPerlSetEnv PERL5LIB /home/bruce/public_html/ffball/myffPerlSetVar INC /home/bruce/public_html/ffball/myffPerlModule Apache2PerlModule Apache::ReloadPerlInitHandler Apache::ReloadPerlSetVar ReloadDebug On# PerlSetVar ReloadModules "FFMgr::*"# This will allow execution of mod_perl to compile your scripts to# subroutines which it will execute directly, avoiding the costly# compile process for most requests.#Alias /perl /var/www/perlDirectory
 /var/www/perl SetHandler perl-script PerlHandler ModPerl::Registry::handler PerlOptions +ParseHeaders Options +ExecCGI/DirectoryDirectory /home/bruce/public_html FilesMatch "\.(pl|pm|cgi)$" SetHandler perl-script PerlHandler ModPerl::Registry::handler PerlOptions +ParseHeaders Options +ExecCGI /FilesMatch/Directoryend-------The PerlSetVar INC line was a futile test.Here's the problem. It seems that the reload module is finding the local modules okay as it shows up in the error_log as checking the mtime. But when they do change, it dies when it tries to reload them and says they aren't in the @INC path.So it's like it is half working.Has anyone else seen
 this problem and have a possible fix?Thanks-Brucewww.bluewolverine.com
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: Apache::Reload and INC path partialy working

2003-08-14 Thread Geoffrey Young


Bruce Tennant wrote:
I'm trying to do some development work with mod_perl and find
restarting the server a pain.  So I setup Apache::Reload, but it
doesn't seem to want to see my local devel directory all the time.
Here's my settings
Apache/2.0.40
mod_perl-1.99_7
please upgrade to the latest CVS version and try again - 1.99_07 is very old.


Linux 2.4.20-8 (RedHat9 I think)

Here's my perl.conf (sourced by httpd.conf)
start
LoadModule perl_module modules/mod_perl.so

PerlSetEnv PERL5LIB /home/bruce/public_html/ffball/myff

Here's the problem.  It seems that the reload module is finding the
local modules okay as it shows up in the error_log as checking the
mtime.  But when they do change, it dies when it tries to reload
them and says they aren't in the @INC path.
ok.  can you show us @INC before and after the reload attempt?  I'm curious 
as to whether PERL5LIB is being properly added to @INC for the request time 
interpreters.

also, does it fail if you reload modules that are not in @INC?  for 
instance, try touching CGI.pm or something in your site_lib and watch the 
debug messages.

So it's like it is half working.

Has anyone ! else seen this problem and have a possible fix?
we'll find a fix if we can isolate and reproduce the problem, don't worry :)

--Geoff



Re: Apache::Reload and INC path partialy working

2003-08-14 Thread Geoffrey Young

Here's my perl.conf (sourced by httpd.conf)
start
LoadModule perl_module modules/mod_perl.so

PerlSetEnv PERL5LIB /home/bruce/public_html/ffball/myff
on second thought, try

PerlSwitches -I/home/bruce/public_html/ffball/myff

or

PerlSwitches -Mlib=/home/bruce/public_html/ffball/myff

instead of PERL5LIB

--Geoff




Fwd: Re: Apache::Reload and INC path partialy working

2003-08-14 Thread Bruce Tennant
Forwarding message as I didn't realize I was missing the list.
Geoffrey Young [EMAIL PROTECTED] wrote:

Date: Tue, 12 Aug 2003 14:18:37 -0400From: Geoffrey Young <[EMAIL PROTECTED]>To: Bruce Tennant <[EMAIL PROTECTED]>Subject: Re: Apache::Reload and INC path partialy workingok, I'll take a look at this.please repost to the list, though, so others can help and your results are recorded.and no, there is no rpm package for the latest CVS version that I know about - you'll need to compile it yourself (which is easy, don't worry :)--GeoffBruce Tennant wrote: The INC is correct (it has the new path in it).  But if I touch a file in the added directory, it detects the file as  being changed (uses proper INC), but seems to not find it when it is  trying to reload it (sees base INC).  I tried another thing, use a startup.pl file, it seems to work 90% of  the time.
 Sometimes when a file is changed or reloaded, one of the sub  httpd process will say it knows nothing about the reloaded module. But  I can work w/this as a hitting reload on the browser fixes this.  Here's the INC when no module is changed: /home/bruce/public_html/ffball/myff  /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache2  /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0  /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi  /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl  /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi  /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .  Here's the INC after I touched Apache/DBI.pm in site_perl and it was  reloaded (seen in log)  /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache2  /usr/lib/perl5/5.8.0/i386-linux-thread-multi
 /usr/lib/perl5/5.8.0  /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi  /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl  /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi  /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl  /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .  It would seem it dropped the perl5lib line.  Oh also, if I remove the "use lib" line in my top file, none of my local  modules will load. I though the PERL5LIB was suppose to add to the base  INC and make it so you didn't need to use "use lib". Maybe this is the  root of the problem.  But as I mentioned, if using a startup script w/PerlRequire, the reloads  seem to work.  Do you know if there's a new rpm package for mod-perl (RH9)?  */Geoffrey Young <[EMAIL PROTECTED]>/* wrote:  
  Bruce Tennant wrote:  I'm trying to do some development work with mod_perl and find  restarting the server a pain. So I setup Apache::Reload, but it  doesn't seem to want to see my local devel directory all the time.   Here's my settings  Apache/2.0.40  mod_perl-1.99_7  please upgrade to the latest CVS version and try again - 1.99_07 is very old.Linux 2.4.20-8 (RedHat9 I think)Here's my perl.conf (sourced by httpd.conf)  start   LoadModule perl_module modules/mod_perl.so   PerlSetEnv PERL5LIB /home/bruce/public_html/ffball/myffHere's the problem. It seems that the reload module is finding the  local modules okay as it shows up in the error_log as checking the 
 mtime. But when th! ey do change, it dies when it tries to reload  them and says they aren't in the @INC path.  ok. can you show us @INC before and after the reload attempt? I'm curious as to whether PERL5LIB is being properly added to @INC for the request time interpreters.  also, does it fail if you reload modules that are not in @INC? for instance, try touching CGI.pm or something in your site_lib and watch the debug messages.So it's like it is half working.   Has anyone ! else seen this problem and have a possible fix?  we'll find a fix if we can isolate and reproduce the problem, don't worry :)  --Geoffwww.bluewolverine.com   Do you Yahoo!?
 Yahoo! SiteBuilder  - Free,  easy-to-use web site design softwarewww.bluewolverine.com
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: Apache::Reload and INC path partialy working

2003-08-14 Thread Ron Savage
Hi Folks

Fascinating to see this on a non-Windows box.

Reloading modules after they have been editied, eg httpd like so:

PerlModule Apache::Reload
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules CGI CGI::Application ... Sweep::*

works about 99% of the time under Win2K and XP. I've been assuming
it's a Windows thing. Perhaps the problem lies deeper?

Server Version: Apache/2.0.46 (Win32) mod_perl/1.99_10-dev
Perl/v5.8.0
--
Ron Savage, [EMAIL PROTECTED] on 14/08/2003. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rons




[PATCH] Apache::DBI - AutoCommit = 1 and begin_work (inc example)

2003-06-12 Thread Patrick Mulvany
Hi,

Came accross a bug when when trying to reduce creation of handles on a site.

Currently Apache::DBI makes the assumption that it AutoCommit = 1 then the handle 
does not need cleaning up. This is not neccessariliy true as begin_work switches off 
the AutoCommit for one transaction.

First time the handle is used AutoCommit=1 and a transaction is started with 
begin_work but the script fails to call either commit or rollback for any reason (ie 
dies) causing an incomplete transaction to exist.

Next time Apache::DBI returns the handle it is still mid transaction and but thinks 
AutoCommit is on which it is not. You therefor end up with following scripts thinking 
every DBI action is auto commited but it is not. Locks develop on the updated tables 
which becomes very messy when not running single process mode.

Usually the only way to remove these locks is by killing the Apache process.

On Oracle the test script uses this table in the scott/tiger schema the bug should 
apply to any DB that impliments transaction but I have only tested against Oracle :-

create table T (A number(20));

When the test script is run with test.cgi?commit=0 then the final transaction is not 
commited :-
SQL truncate table T;
truncate table T
   *
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified

But with test.cgi?commit=1 then the last transactio is committed or then the patch 
applied then it rolls back and this works:-
SQL truncate table T;

Table truncated.


Please find attached the example script and the patch against CVS v1.7.

Thank you

Paddy
#!/usr/bin/perl
use strict;
use CGI;
use DBI;
use Data::Dumper;

my $cgi = new CGI();

print $cgi-header();
# Apache::DBI test code
my $DBI_CONNECT= dbi:Oracle:host=xx.xx.xx.xx;sid=;
my $dbh = DBI-connect($DBI_CONNECT,'scott','tiger');
my $query1 = 'select A from T';
my $sth = $dbh-prepare($query1);
$sth-execute();
print h1Test Results/h1\n;
print 'pre'.Dumper($sth-fetchall_arrayref)./pre\n;

my $before = $dbh-{AutoCommit};
$dbh-begin_work();
my $after = $dbh-{AutoCommit};
my $query2 = 'insert into T (A) values (?)';
my $sth2 = $dbh-prepare($query2);

print h1Test Error Trans/h1\n;
my $time1=time;
print This should commit $time1\n;
$sth2-execute($time1);
$dbh-commit();

print h1Test Error Trans/h1\n;
$dbh-begin_work();
my $time2=time+10;
print This should roll back $time2\n if (!$cgi-param('commit'));
$sth2-execute($time2);
$dbh-commit() if ($cgi-param('commit'));

1;
--- DBI/DBI.pm  2003-06-10 12:20:06.0 +
+++ DBI/DBI.pm  2003-06-10 12:42:07.0 +
@@ -87,9 +87,10 @@
 }
 
 # this PerlCleanupHandler is supposed to initiate a rollback after the script has 
finished if AutoCommit is off.
-my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0;
+# however cleanup can only be determined at end of handle life as begin_work may 
have been called to temporarily turn off AutoCommit.
+#
 # TODO - Fix mod_perl 2.0 here
-if(!$Rollback{$Idx} and $needCleanup and Apache-can('push_handlers')) {
+if(!$Rollback{$Idx} and Apache-can('push_handlers')) {
 print STDERR $prefix push PerlCleanupHandler \n if $Apache::DBI::DEBUG  1;
 Apache-push_handlers(PerlCleanupHandler, \cleanup);
 # make sure, that the rollback is called only once for every 


pgp0.pgp
Description: PGP signature


Re: [error] Can't locate CGI.pm in @INC

2003-05-30 Thread Ed
On Thu, May 29, 2003 at 04:12:51PM +1000, Stas Bekman wrote:
 Brown, Jeffrey wrote:
 Problem solved!
 
 You all are a fantastic resource to newbies!
 
 Jeff
 
 -Original Message-
 From: Ed [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 28, 2003 9:28 PM
 To: Brown, Jeffrey; [EMAIL PROTECTED]
 
 On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote:
 
 Here are the results from the log file:
 
 [Wed May 28 20:50:21 2003] [error] No such file or directory at
 /htdocs/perl/first.pl line 6 during global destruction.
 
 
 openbsd's httpd is chrooted.
 
 Again, can someone please post a patch/addition for the troubleshooting.pod 
 doc explaining the problem and the solution in details. I've seen this kind 
 of questions more than once here.
 
 Should go into OpenBSD cat at:
 http://perl.apache.org/docs/1.0/guide/troubleshooting.html#OS_Specific_Notes
 Get the pod by clicking on the [src] button.

For the list archive:

- rtfm
-u disables chroot. httpd(8)
http://www.openbsd.org/faq/faq10.html#httpdchroot


- set up chroot basics
The doc for setting up an anoncvs mirror could be adapted for mod_perl.
http://www.openbsd.org/anoncvs.shar
Ofcourse much of it doesn't apply, but the part about ld.so, etc. is
helpful.


- List archives
dreamwvr figured out how to actually get things to work and posted notes
to the list. (so see archives)


- 3.3-current (soon to be 3.4)
And one last bit added after 3.3 was released, Revision 1.7 to apachectl:
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/httpd/src/support/apachectl

pick's up httpd_flags from /etc/rc.conf, so you can just add -DSSL -u to
httpd_flags.


- ports
The openbsd ports system is not by default configured to install
perl modules or packages in the chroot environment. You would have to
set PREFIX or LOCALBASE. see bsd.port.mk(5) and ports(7)
(PHP ports are set up for chroot installs).


- goolge
A nice HOWTO run mod_perl chrooted would be nice.  maybe someone's
already written it?


I hope this helps some.


Ed.


[error] Can't locate CGI.pm in @INC

2003-05-29 Thread Brown, Jeffrey








I have installed OpenBSD 3.2, with
Apache 1.3.26, and mod_perl 1.26 which was installed
as a package. I have rebooted, stopped and started apache. I have permissions
of 755 on my perl scripts and here is my error log:



[Wed May 28 19:33:57 2003] [error]
Can't locate CGI.pm in @INC (@INC contains:
/usr/local/lib/site_perl/5.6.1/i386-openbsd
/usr/libdata/perl5/i386-openbsd/5.6.1
/usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5
/usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd
/usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl
/usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl .
/var/www/ /var/www/lib/perl)
at /htdocs/perl/hellothere.pl line 3 during global destruction.

BEGIN failed--compilation aborted at
/htdocs/perl/hellothere.pl line 3 during global destruction.



When I do a find for CGI.pm here
are the results:



as07# find / -name CGI.pm

/usr/libdata/perl5/CGI.pm



I have looked through the online mod_perl
docs to no avail. Any help would be greatly appreciated!



Jeff Brown










Re: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Perrin Harkins
On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote:
 [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC
 contains: 
[...]
 /usr/libdata/perl5/CGI.pm

This sort of thing is usually a permissions problem.  Try opening that
file (full path to CGI.pm) from your CGI and see if it lets you.

- Perrin



Re: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Stas Bekman
Brown, Jeffrey wrote:
I have installed OpenBSD 3.2, with Apache 1.3.26, and mod_perl 1.26 
which was installed as a package. I have rebooted, stopped and started 
apache. I have permissions of 755 on my perl scripts and here is my 
error log:

 

[Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC 
contains: /usr/local/lib/site_perl/5.6.1/i386-openbsd 
/usr/libdata/perl5/i386-openbsd/5.6.1 
/usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 
/usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd 
/usr/libdata/perl5/site_perl/i386-openbsd 
/usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl 
/usr/local/lib/perl5/site_perl . /var/www/ /var/www/lib/perl) at 
/htdocs/perl/hellothere.pl line 3 during global destruction.

BEGIN failed--compilation aborted at /htdocs/perl/hellothere.pl line 3 
during global destruction.
global destruction?

When I do a find for CGI.pm here are the results:

as07# find / -name CGI.pm

/usr/libdata/perl5/CGI.pm
/usr/libdata/perl5/ is in @INC. Check CGI.pm perms. See that it is readable by 
the user that is running the server.



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Brown, Jeffrey
Here are the permissions on the file:

-r--r--r--  1 root  wheel  224666 Apr 28 06:35 CGI.pm

The BSD OS is new to me, I am more familure with redhat...but there are
some definite perks to OpenBSD and that is why I run it. Anyway wheel is
the group, and Apache uses the user and group www to run the server. Any
more help?

Jeff

-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 7:50 PM
To: Brown, Jeffrey
Cc: [EMAIL PROTECTED]

On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote:
 [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC
 contains: 
[...]
 /usr/libdata/perl5/CGI.pm

This sort of thing is usually a permissions problem.  Try opening that
file (full path to CGI.pm) from your CGI and see if it lets you.

- Perrin





RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Perrin Harkins
On Wed, 2003-05-28 at 23:15, Brown, Jeffrey wrote:
 Here are the permissions on the file:
 
 -r--r--r--  1 root  wheel  224666 Apr 28 06:35 CGI.pm
 
 The BSD OS is new to me, I am more familure with redhat...but there are
 some definite perks to OpenBSD and that is why I run it. Anyway wheel is
 the group, and Apache uses the user and group www to run the server. Any
 more help?

It could be a directory above that is the problem.  Try the test I
suggested and you will know for sure.

- Perrin



RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Brown, Jeffrey
Do you mean give the path in my perl script?

So the line in my code:

use CGI qw(:standard);

would be:

use /usr/libdata/perl5/CGI qw(:standard);

jeff

-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 7:50 PM
To: Brown, Jeffrey
Cc: [EMAIL PROTECTED]

On Wed, 2003-05-28 at 22:39, Brown, Jeffrey wrote:
 [Wed May 28 19:33:57 2003] [error] Can't locate CGI.pm in @INC (@INC
 contains: 
[...]
 /usr/libdata/perl5/CGI.pm

This sort of thing is usually a permissions problem.  Try opening that
file (full path to CGI.pm) from your CGI and see if it lets you.

- Perrin





RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Randy Kobes
On Wed, 28 May 2003, Brown, Jeffrey wrote:

 Do you mean give the path in my perl script?
 So the line in my code:
 use CGI qw(:standard);
 would be:
 use /usr/libdata/perl5/CGI qw(:standard);

I think what Perrin had in mind was to try, in your CGI
script, something like
   open(FILE, '/usr/libdata/perl5/CGI.pm')
  or die Cannot read CGI.pm: $!;
This would test if the user under which the web
server is running under has permission to open CGI.pm.

-- 
best regards,
randy kobes




RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Perrin Harkins
On Wed, 2003-05-28 at 23:25, Brown, Jeffrey wrote:
 Do you mean give the path in my perl script?
 
 So the line in my code:
 
 use CGI qw(:standard);
 
 would be:
 
 use /usr/libdata/perl5/CGI qw(:standard);

Actually, what I had in mind was just this:

open(CGI, '/usr/libdata/perl5/CGI.pm') or die $!;

If you can't read the file, that line will die.

- Perrin



Re: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Ed
On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote:
 Here are the results from the log file:
 
 [Wed May 28 20:50:21 2003] [error] No such file or directory at
 /htdocs/perl/first.pl line 6 during global destruction.

openbsd's httpd is chrooted.

Ed.


RE: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Brown, Jeffrey
Problem solved!

You all are a fantastic resource to newbies!

Jeff

-Original Message-
From: Ed [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 9:28 PM
To: Brown, Jeffrey; [EMAIL PROTECTED]

On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote:
 Here are the results from the log file:
 
 [Wed May 28 20:50:21 2003] [error] No such file or directory at
 /htdocs/perl/first.pl line 6 during global destruction.

openbsd's httpd is chrooted.

Ed.




Re: [error] Can't locate CGI.pm in @INC

2003-05-29 Thread Stas Bekman
Brown, Jeffrey wrote:
Problem solved!

You all are a fantastic resource to newbies!

Jeff

-Original Message-
From: Ed [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 9:28 PM
To: Brown, Jeffrey; [EMAIL PROTECTED]

On Wed, May 28, 2003 at 09:11:06PM -0700, Brown, Jeffrey wrote:

Here are the results from the log file:

[Wed May 28 20:50:21 2003] [error] No such file or directory at
/htdocs/perl/first.pl line 6 during global destruction.


openbsd's httpd is chrooted.
Again, can someone please post a patch/addition for the troubleshooting.pod 
doc explaining the problem and the solution in details. I've seen this kind of 
questions more than once here.

Should go into OpenBSD cat at:
http://perl.apache.org/docs/1.0/guide/troubleshooting.html#OS_Specific_Notes
Get the pod by clicking on the [src] button.
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-04-06 Thread Stas Bekman
I've committed the code that adds SERVER_ROOT and SERVER_ROOT/lib/perl to 
@INC, but it's disabled if an explicit MP_COMPAT_1X=0 is passed to Makefile.PL 
(it's enabled by default).

I'll document shortly what other mp1-compat features can be disabled by 
passing MP_COMPAT_1X=0...

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Addition of directory to @INC variable via startup script/mod_perl

2003-03-24 Thread Jason Jolly



I currently have the following 
configuration in my httpd.conf file:

 PerlRequire 
/usr/local/apache/conf/startup.pl Alias /perl/ 
/usr/local/apache/cgi-bin PerlTaintCheck 
On PerlWarn 
On PerlFreshRestart On 
PerlTransHandler Apache::SessionManager PerlFreshRestart 
On

 Location 
/perl SetHandler 
perl-script PerlSendHeader On 
PerlHandler Apache::Registry 
Options 
ExecCGI /Location

And here are the contents of the startup.pl 
script:

 
#!/usr/bin/perl

 use strict;

 use lib 
qw(/usr/local/apache/require); 
 use 
Apache::Registry(); use CGI(); use 
CGI::Session(); use CGI::Carp(); use 
DBI(); use Net::LDAP();

 $ENV{MOD_PERL} or die 
"not running under mod_perl!";

 1;

When I stop/start the server and run a 
script with the following code:

 foreach $item (@INC) 
{ print ($item . 
"br"); }

I only get the output:

 /usr/local/lib/perl5/5.8.0/sun4-solaris 
/usr/local/lib/perl5/5.8.0 
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris 
/usr/local/lib/perl5/site_perl/5.8.0 
/usr/local/lib/perl5/site_perl .

?? I can't seem to find any rhyme or 
reason why the directory "/usr/local/apache/require" isn't on the @INC 
array?

Any help is greatly 
appreciated.according to all documentation I can find this should actually 
work. I'm hoping that I'm doing something terribly stupid :).

thnx,

~j




Re: Addition of directory to @INC variable via startup script/mod_perl

2003-03-24 Thread Perrin Harkins
Jason Jolly wrote:
When I stop/start the server and run a script with the following code:
 
foreach $item (@INC) {
print ($item . br);
}
 
I only get the output:
 
/usr/local/lib/perl5/5.8.0/sun4-solaris
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.
 
??  I can't seem to find any rhyme or reason why the directory 
/usr/local/apache/require isn't on the @INC array?
When do you run that script?  And why do you have PerlFreshRestart on?

- Perrin



[mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-03-18 Thread Stas Bekman
Nick Tonkin wrote:
On Mon, 17 Mar 2003, Perrin Harkins wrote:


Goehring, Chuck Mr., RCI - San Diego wrote:

	Where do you put your .pm files for application-specific code?
Under mod_perl 1, I just put them in SERVER_ROOT/lib/perl, which is
automatically added to @INC by mod_perl.  Can someone confirm if this
still works for mp2?


I do not believe so. 
Though it is easy to add. See the patch below.

The question is, do we want to have this feature in mp2? Does it really save 
someone a trouble of creating a startup file? Also, In 2.0 you don't have to 
create a startup file for that, you can simply say:

PerlSwitches -I/home/httpd -I/home/httpd/lib/perl

Admittedly you will have to hardcode the document root in this case, but you 
do that anyways in httpd.conf when you specify it.

Index: src/modules/perl/mod_perl.c
===
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.157
diff -u -r1.157 mod_perl.c
--- src/modules/perl/mod_perl.c 17 Mar 2003 02:15:09 -  1.157
+++ src/modules/perl/mod_perl.c 18 Mar 2003 22:55:08 -
@@ -190,6 +190,11 @@
 );
 #endif
+av_push(GvAV(PL_incgv),
+newSVpv(ap_server_root_relative(p, ), 0));
+av_push(GvAV(PL_incgv),
+newSVpv(ap_server_root_relative(p, lib/perl), 0));
+
 if (!modperl_config_apply_PerlRequire(s, scfg, perl, p)) {
 exit(1);
 }


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-03-18 Thread Perrin Harkins
Stas Bekman wrote:
The question is, do we want to have this feature in mp2?
I thought it was cool to have it automatically add a path relative to 
the server root, because it makes it feel more like you are writing real 
Apache modules, and not just CGI scripts.  It's just a warm fuzzy thing 
really.  I have no problem with dropping that feature and adding the 
path myself in startup.pl or httpd.conf.

- Perrin



Re: [mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-03-18 Thread Stas Bekman
Perrin Harkins wrote:
Stas Bekman wrote:

The question is, do we want to have this feature in mp2?


I thought it was cool to have it automatically add a path relative to 
the server root, because it makes it feel more like you are writing real 
Apache modules, and not just CGI scripts.  It's just a warm fuzzy thing 
really.  I have no problem with dropping that feature and adding the 
path myself in startup.pl or httpd.conf.
I'm +0 on adding this feature. While I have never used it myself, I see no 
harm in keeping back-compatibility with 1.0. Unless someone has a reason for 
not having it I'll commit the patch I've posted earlier.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-03-18 Thread Geoffrey Young


Stas Bekman wrote:
Perrin Harkins wrote:

Stas Bekman wrote:

The question is, do we want to have this feature in mp2?


I thought it was cool to have it automatically add a path relative to 
the server root, because it makes it feel more like you are writing 
real Apache modules, and not just CGI scripts.  It's just a warm fuzzy 
thing really.  I have no problem with dropping that feature and adding 
the path myself in startup.pl or httpd.conf.


I'm +0 on adding this feature. While I have never used it myself, I see 
no harm in keeping back-compatibility with 1.0. Unless someone has a 
reason for not having it I'll commit the patch I've posted earlier.
in 1.0 I used it all the time and liked having it there.  however, I 
suspect that doug left it out on purpose - IIRC PerlSwitches was his 
answer when this was asked before (maybe it was at a conference, I 
can't remember).

anyway, I'd say do it and let purists complain later - it will make 
porting that much more seamless.

--Geoff



Re: [mp2] adding SERVER_ROOT and SERVER_ROOT/lib/perl to @INC

2003-03-18 Thread Nick Tonkin
On Tue, 18 Mar 2003, Geoffrey Young wrote:



 Stas Bekman wrote:
  Perrin Harkins wrote:
 
  Stas Bekman wrote:
 
  The question is, do we want to have this feature in mp2?
 
 
 
  I thought it was cool to have it automatically add a path relative to
  the server root, because it makes it feel more like you are writing
  real Apache modules, and not just CGI scripts.  It's just a warm fuzzy
  thing really.  I have no problem with dropping that feature and adding
  the path myself in startup.pl or httpd.conf.
 
 
  I'm +0 on adding this feature. While I have never used it myself, I see
  no harm in keeping back-compatibility with 1.0. Unless someone has a
  reason for not having it I'll commit the patch I've posted earlier.

Is there a performance hit to having @INC include another directory (that
will not be used by many [most?] users)? If so, that's a good argument
against.


 in 1.0 I used it all the time and liked having it there.  however, I
 suspect that doug left it out on purpose - IIRC PerlSwitches was his
 answer when this was asked before (maybe it was at a conference, I
 can't remember).

I think Doug was right. PerlSwitches is a more flexible, more perlsih and
mod_perlish way of doing it, IMO. Just needs good documentation :)

- nick

-- 


Nick Tonkin   {|8^)



Re: about @INC and handlers directory

2003-02-02 Thread Stas Bekman
Iñaki Martínez wrote:

Hi!!!

 Well this is my firts post in this list...

 I have a server with several domains which each of them has its own
handlers, subroutines and there are several common subrutines.

 What i want to do it is organize the directory structure, so:

  /modperl/domain_1/
  /modperl/domain_2/
  /modperl/domain_3/

  /modperl/domain_n/

  /modperl/common/

 Inside of each one, the handler and subroutines of each domain.

 The the handlers are:

 PerlHandler domain_1
 ...
 PerlHandler domain_n

 to use the common subroutines:

 common::subroutine_n



 Now my questions:


 1) is this directory structure correct???
 2) can it be improve???
 3) security matters?
 4) IMPORTANT: how to set the @INC and where


 any help, tips, URL are welcome


The URL is: http://perl.apache.org/docs/

If you have commons subs, you should be fine as long as they live in the files 
with declared packages. See:
http://perl.apache.org/docs/1.0/guide/porting.html#Script_s_name_space

Having a separate @INC for each domain is not possible under mod_perl 1.0 (it 
does work under 2.0), though there are workarounds which may be inadequate for 
a heavily loaded server.
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



about @INC and handlers directory

2003-02-01 Thread Iñaki Martínez
Hi!!!

 Well this is my firts post in this list...

 I have a server with several domains which each of them has its own
handlers, subroutines and there are several common subrutines.

 What i want to do it is organize the directory structure, so:

  /modperl/domain_1/
  /modperl/domain_2/
  /modperl/domain_3/

  /modperl/domain_n/

  /modperl/common/

 Inside of each one, the handler and subroutines of each domain.

 The the handlers are:

 PerlHandler domain_1
 ...
 PerlHandler domain_n

 to use the common subroutines:

 common::subroutine_n



 Now my questions:


 1) is this directory structure correct???
 2) can it be improve???
 3) security matters?
 4) IMPORTANT: how to set the @INC and where


 any help, tips, URL are welcome


 Thanks in advance





AW: PerlSwitches -M and @INC

2003-01-27 Thread Helmut Zeilinger
Hi,

after i recompiled the newest versions of perl, apache and mod_perl on
my home computer with the appropriate debug switches, i cannot reproduce
the Segmentation Faults any more, too.
At my machine at work i found out that the problem had to do with the
DBI module, which i additionally loaded. After installing the newest
version of DBI and/or not loading this module, no Segmentation faults
happened any more.

Concerning the PerlOptions:

From the results below i conclude:

+Parent means everything is new in the virtual host. You have to add the
libs and paths you need all there.

+Clone means everything is cloned from the main configuration. To add
a private lib path you have to call a second startup script with the
lib path you need included. The PerlSwitches -Mlib=.. in the virtual
host section are ignored.

+inherit makes no difference at all (probably i did/do not understand
that option)

So after everything is clear now (i have to sleep one night over it) i
will continue moving from 1.3 to 2.0.

Thanks for your help

Helmut



1) 

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

NameVirtualHost 127.0.0.1:8080
VirtualHost 127.0.0.1:8080
   ..
PerlOptions +Parent
PerlModule  Apache2
PerlSwitches -Mlib=/test2/lib
  ..
/VirtualHost

startup.pl:

#!/usr/bin/perl
use Apache2;
use ModPerl::Registry;
1;


The result of @INC in a perl script:

/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test2/lib
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.


2)

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

VirtualHost 127.0.0.1:8080
..
PerlOptions +Clone
PerlSwitches -Mlib=/test2/lib
..  
/VirtualHost

startup.pl: see above

@INC:

/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test1
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.

3)

+Clone  and +inherit the same result as 2)

4)

httpd.conf:

PerlRequire /tmp/install/apache2/conf/startup.pl
PerlSwitches -Mlib=/test1

VirtualHost 127.0.0.1:8080
..
PerlOptions +Clone
PerlRequire /tmp/install/apache2/conf/addlib.pl
..  
/VirtualHost

startup.pl: see above
addlib.pl:
..
use lib '/addlib';
..

@INC:

/addlib 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2
/test1
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.   


-Ursprüngliche Nachricht-
Von: Stas Bekman [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 25. Januar 2003 11:25
An: Helmut Zeilinger
Cc: [EMAIL PROTECTED]
Betreff: Re: PerlSwitches -M and @INC


Dr. Helmut Zeilinger wrote:
 I tried:
 
   PerlOptions +Parent
 #  PerlOptions +Clone
 
 
   PerlModule  Apache2
   PerlModule Apache::compat
   PerlSwitches -Mlib=/et/www/envirotex/lib
 
 The result is a Segmentation fault without any further messages on
the 
 screen and in the error_log file.

I can't reproduce it. Please send in the backtrace from the core file
and the 
rest of the details. See:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

 When I try:
 
 #   PerlOptions +Parent
   PerlOptions +Clone
 
 
   PerlModule  Apache2
   PerlModule Apache::compat
   PerlSwitches -Mlib=/et/www/envirotex/lib

If you use the +Clone, it already inherits everything from the parent, 
including @INC. So you don't need the last 3 lines. It works just fine
for me 
with 'PerlOptions +Clone'.

Perhaps you can send in your httpd.conf after you have reduced it to the
very 
minimum (including the minimal startup.pl that still reproduces the
problem)

 the result

Re: PerlSwitches -M and @INC

2003-01-25 Thread Stas Bekman
Dr. Helmut Zeilinger wrote:

I tried:

  PerlOptions +Parent
#  PerlOptions +Clone


  PerlModule  Apache2
  PerlModule Apache::compat
  PerlSwitches -Mlib=/et/www/envirotex/lib

The result is a Segmentation fault without any further messages on the 
screen and in the error_log file.

I can't reproduce it. Please send in the backtrace from the core file and the 
rest of the details. See:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

When I try:

#   PerlOptions +Parent
  PerlOptions +Clone


  PerlModule  Apache2
  PerlModule Apache::compat
  PerlSwitches -Mlib=/et/www/envirotex/lib


If you use the +Clone, it already inherits everything from the parent, 
including @INC. So you don't need the last 3 lines. It works just fine for me 
with 'PerlOptions +Clone'.

Perhaps you can send in your httpd.conf after you have reduced it to the very 
minimum (including the minimal startup.pl that still reproduces the problem)

the result is:

[Thu Jan 23 09:12:19 2003] [error] Can't locate 
Emma/AuthCookieHandler.pm in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2 
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1 
/usr/lib/perl5/site_perl .) at (eval 5) line 3.

[Thu Jan 23 09:12:19 2003] [error] Can't load Perl module 
Emma::AuthCookieHandler for server www.et:0, exiting...

The Module Emma::AuthCookieHandler is in the path 
/et/www/envirotex/lib. As i see from the message above the additional 
lib path is missing from the @INC Array.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: PerlSwitches -M and @INC

2003-01-23 Thread Dr. Helmut Zeilinger
I tried:

  PerlOptions +Parent 

#  PerlOptions +Clone 



  PerlModule  Apache2 

  PerlModule Apache::compat 

  PerlSwitches -Mlib=/et/www/envirotex/lib

The result is a Segmentation fault without any further messages on the 
screen and in the error_log file.

When I try:

#   PerlOptions +Parent 

  PerlOptions +Clone 



  PerlModule  Apache2 

  PerlModule Apache::compat 

  PerlSwitches -Mlib=/et/www/envirotex/lib

the result is:

[Thu Jan 23 09:12:19 2003] [error] Can't locate Emma/AuthCookieHandler.pm 
in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache2 
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0 
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1 
/usr/lib/perl5/site_perl .) at (eval 5) line 3.

[Thu Jan 23 09:12:19 2003] [error] Can't load Perl module 
Emma::AuthCookieHandler for server www.et:0, exiting...

The Module Emma::AuthCookieHandler is in the path 
/et/www/envirotex/lib. As i see from the message above the additional lib 
path is missing from the @INC Array.

Helmut

--On Donnerstag, 23. Januar 2003 12:42 +1100 Stas Bekman [EMAIL PROTECTED] 
wrote:

Helmut Zeilinger wrote:

Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

	PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

	PerlOptions +Parent

	PerlSwitches -Mlib=/et/www/envirotex/lib

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too.


That's because you get a completely new interpreter. So you have to run
Apache2 again

   PerlOptions +Parent
   PerlModule Apache2

Does that work for you?

I agree that this is not-intuitive and adds to a clutter. I suppose that
this should be documented for the time being. And hopefully by the time
2.0 is released we will come up with a transparent solution.

Have you tried using the +Clone option instead?
http://perl.apache.org/docs/2.0/user/config/config.html#C_Clone_

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com







PerlSwitches -M and @INC

2003-01-22 Thread Helmut Zeilinger
Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

PerlOptions +Parent

PerlSwitches -Mlib=/et/www/envirotex/lib  

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too. 


Helmut








Re: PerlSwitches -M and @INC

2003-01-22 Thread Stas Bekman
Helmut Zeilinger wrote:

Hi,

i am trying Apache 2.0.44 and mod_perl 1.99_08.

httpd.conf :Bevor all virtual hosts

	PerlRequire /usr/local/apache2/conf/virtual/startup.pl

The content of startup.pl is as in the mod_perl documentation including
the use Apache::compat() directive.

I one of my V-hosts i say (as described in the documentation):

	PerlOptions +Parent

	PerlSwitches -Mlib=/et/www/envirotex/lib  

When I start the server i get the error message:


[Wed Jan 22 13:52:07 2003] [error] Can't locate loadable object for
module Apache::Constants in @INC (@INC contains: /et/www/envirotex/lib
/usr/lib/perl5/5.8.0/i686-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .) at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/mod_perl.pm line
14
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
BEGIN failed--compilation aborted at
/usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi/Apache.pm line 6.
Compilation failed in require at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
BEGIN failed--compilation aborted at
/et/www/envirotex/lib/Emma/AuthCookieHandler.pm line 3.
Compilation failed in require at (eval 1) line 3.

[Wed Jan 22 13:52:07 2003] [error] Can't load Perl module
Emma::AuthCookieHandler for server www.et:0, exiting...


It seems to me, that all of the Apache2 paths create by the use
Apache2 directive are no more present in the @INC Array.

I tried a lot of things with several combinations of PerlSwitches (-M,
-I, -Mblib, -Mlib), and startup files, but I never got the result i
want:

I would like to load some private Modules under
/et/www/envirotex/lib and all the other things should work too. 

That's because you get a completely new interpreter. So you have to run 
Apache2 again

  PerlOptions +Parent
  PerlModule Apache2

Does that work for you?

I agree that this is not-intuitive and adds to a clutter. I suppose that this 
should be documented for the time being. And hopefully by the time 2.0 is 
released we will come up with a transparent solution.

Have you tried using the +Clone option instead?
http://perl.apache.org/docs/2.0/user/config/config.html#C_Clone_

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Why is my mod_perl's @INC different?

2002-12-28 Thread Philip Mak
When I use perl from the command line, my @INC is this:

$ perl -eprint join(':', @INC)
/usr/lib/perl5/5.6.1/i386-linux:/usr/lib/perl5/5.6.1:/usr/lib/perl5/site_perl/5.6.1/i386-linux:/usr/lib/perl5/site_perl/5.6.1:/usr/lib/perl5/site_perl/5.6.0:/usr/lib/perl5/site_perl:.

When I print @INC from a mod_perl script, it is this:

/home/mirror/global:/usr/lib/perl5/5.6.1/i686-linux:/usr/lib/perl5/5.6.1:/usr/lib/perl5/site_perl/5.6.1/i686-linux:/usr/lib/perl5/site_perl/5.6.1:/usr/lib/perl5/site_perl:.:/home/mirror/httpd/:/home/mirror/httpd/lib/perl

How did this happen? Why does my command line perl use i386-linux,
while my mod_perl uses i686-linux?

My problem is, any modules I install go into i386-linux. They're not
accessible to mod_perl. I need to install a new module for my site but
I can't access it in mod_perl.

I've tried adding use lib qw(/usr/lib/perl5/5.6.1/i386-linux); in
startup.pl, but then it makes Apache not start at all:

/usr/local/perlhttpd/bin/httpd: relocation error: 
/usr/lib/perl5/5.6.1/i386-linux/auto/Data/Dumper/Dumper.so: undefined symbol: 
perl_get_sv
/home/mirror/bin/apachectl start: httpd could not be started

Any idea what's going on here?



Re: Why is my mod_perl's @INC different?

2002-12-28 Thread perrin
 How did this happen? Why does my command line perl use i386-linux,
 while my mod_perl uses i686-linux?

Simple: they are compiled to use different installations of Perl.  If you
want to unify them, you can find out what mod_perl is using and put it
first in your path (so that perl will run it) or you can replace one or
the other with a new compile.
- Perrin






Per Vhost @INC

2002-12-10 Thread siberian
This has come up a few times but I still do not fully 
understand how it works. Here is my situation.

I have a body of software that runs in a specific 
namespace with about 10 libraries. (TourEngine::**). I 
have many versions of this software and will need the 
ability to, on the same server, run multiple instances of 
this software with different versions for a variety of 
reasons.

Using a PerlRequire in the vhost seems to add the @INC for 
the entire vhost population on the server, not just my 
vhost. This results in 'first match wins' behavior since I 
would now have an @INC entry for each TourEngine::** 
directory. I tried Apache::PerlVINC but it wants to reload 
each module on each request and it seems to want to 'own' 
a location space. My modules actually get required as part 
of my HTML::Mason code, they do not handle the entire 
Location.

I tried the PerlFixupHandler and a use libs declaration 
but that just gave me error messages like 'Undefined 
subroutine lib(use::handler called.' which makes me think 
I have the syntax wrong there and I can not find another 
syntax example.

My preference is not to have to set my @INC in every 
component/lib I call but to have it set in the config 
globally for that Vhost.

So, does anyone have any ideas on how I can load a per 
vhost @INC that doesn't appear to other Vhosts? I want my 
TourEngine::** namespace to be a unique @INC per vhost.

Thanks
John-


Re: Per Vhost @INC

2002-12-10 Thread Kyle Oppenheim
I think you are confusing @INC and %INC.  You should probably read up on the
difference between the two.  The mod_perl guide provides a lot of background
on this issue:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#use__
__requiredo_INC_and__INC_Explained

In any case, @INC and %INC are only used to load modules.  You can't have
multiple versions of the same package loaded at the same time in a single
interpreter (even outside of mod_perl) since the symbols in the symbol table
can only point to one thing at a time.  Remember that there's only one Perl
interpreter per child process (in Apache/mod_perl 1.x).  If you try to load
the same package again via `require' you'll overwrite the old symbols and,
if you have warnings on, generate a bunch of redefine warnings.

As you discovered, Apache::PerlVINC is just a work-around that reloads every
module (at least those that you say matter) on every request.  That's the
best you can do unless Perl starts supporting some method of side-by-side
versioning of modules.

--
Kyle Oppenheim
Tellme Networks, Inc.
http://www.tellme.com

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 5:29 PM
Subject: Per Vhost @INC


 This has come up a few times but I still do not fully
 understand how it works. Here is my situation.

 I have a body of software that runs in a specific
 namespace with about 10 libraries. (TourEngine::**). I
 have many versions of this software and will need the
 ability to, on the same server, run multiple instances of
 this software with different versions for a variety of
 reasons.

 Using a PerlRequire in the vhost seems to add the @INC for
 the entire vhost population on the server, not just my
 vhost. This results in 'first match wins' behavior since I
 would now have an @INC entry for each TourEngine::**
 directory. I tried Apache::PerlVINC but it wants to reload
 each module on each request and it seems to want to 'own'
 a location space. My modules actually get required as part
 of my HTML::Mason code, they do not handle the entire
 Location.

 I tried the PerlFixupHandler and a use libs declaration
 but that just gave me error messages like 'Undefined
 subroutine lib(use::handler called.' which makes me think
 I have the syntax wrong there and I can not find another
 syntax example.

 My preference is not to have to set my @INC in every
 component/lib I call but to have it set in the config
 globally for that Vhost.

 So, does anyone have any ideas on how I can load a per
 vhost @INC that doesn't appear to other Vhosts? I want my
 TourEngine::** namespace to be a unique @INC per vhost.

 Thanks
 John-





Re: Apache::Reload and @INC

2002-11-28 Thread Stas Bekman
Igor Vylusko wrote:

in doc
http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
declared that when using Apache::Reload I may define additional lib
in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
But when I enable PerlInitHandler Apache::Reload in config all libs defined in
PERL5LIB are gone away from @INC.
I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
in VirtualHost sections.
I have bulk of VirtualHosts and would like make @INC different for each
one(i.e. not use lib ... in startup.pl).




SB It's not easy with mod_perl 1.0. The manpage is talking about changing 
SB @INC globally for the whole server. I usually do that with 'use lib' in 
SB startup.pl.

I define PerlSetEnv PERL5LIB globaly for the whole server but PERL5LIB
was stripped out from @INC anyway on enabling PerlInitHandler Apache::Reload
in _any_ vhost.
I am using PerlSetEnv PERL5LIB per vhost basis and it works fine for me
without Apache::Reload.

I can't reproduce what you see with Apache::Reload and I don't see 
anything in the code that mangles @INC.

Though what I do see, is that if you define PERL5LIB outside a 
VirtualHost, it overrides any PERL5LIB defined inside all VirtualHosts, 
no matter if you use Apache::Reload or not. I don't remember if that's 
how it should be or whether it's a bug. Those who use vhosts can 
probably help rectify the issue here.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Apache::Reload and @INC

2002-11-27 Thread Igor Vylusko
Hi All,

in doc
http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
declared that when using Apache::Reload I may define additional lib
in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
But when I enable PerlInitHandler Apache::Reload in config all libs defined in
PERL5LIB are gone away from @INC.
I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
in VirtualHost sections.
I have bulk of VirtualHosts and would like make @INC different for each
one(i.e. not use lib ... in startup.pl).

Has anybody run across this problem?
If sowhat is my solution?

Thanks a lot,
Igor.




Re: Apache::Reload and @INC

2002-11-27 Thread Stas Bekman
Igor Vylusko wrote:

Hi All,

in doc
http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
declared that when using Apache::Reload I may define additional lib
in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
But when I enable PerlInitHandler Apache::Reload in config all libs defined in
PERL5LIB are gone away from @INC.
I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
in VirtualHost sections.
I have bulk of VirtualHosts and would like make @INC different for each
one(i.e. not use lib ... in startup.pl).


It's not easy with mod_perl 1.0. The manpage is talking about changing 
@INC globally for the whole server. I usually do that with 'use lib' in 
startup.pl.

Has anybody run across this problem?
If sowhat is my solution?


There are several solutions, none of which is very helpful in 
production, since they either slow things down or may cause collisions 
when modules with the same names are loaded, see:
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_
_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re[2]: Apache::Reload and @INC

2002-11-27 Thread Igor Vylusko
 in doc
 http://perl.apache.org/docs/2.0/api/mod_perl-2.0/Apache/Reload.html
 declared that when using Apache::Reload I may define additional lib
 in httpd.conf: PerlSetEnv PERL5LIB /home/httpd/perl/extra
 But when I enable PerlInitHandler Apache::Reload in config all libs defined in
 PERL5LIB are gone away from @INC.
 I have Apache 1.3.27, mod_perl 1.27, Apache::Reload 0.07, perl 5.8.0
 on RH7.2 and try PerlSetEnv PERL5LIB in main config section as well as
 in VirtualHost sections.
 I have bulk of VirtualHosts and would like make @INC different for each
 one(i.e. not use lib ... in startup.pl).

SB It's not easy with mod_perl 1.0. The manpage is talking about changing 
SB @INC globally for the whole server. I usually do that with 'use lib' in 
SB startup.pl.

I define PerlSetEnv PERL5LIB globaly for the whole server but PERL5LIB
was stripped out from @INC anyway on enabling PerlInitHandler Apache::Reload
in _any_ vhost.
I am using PerlSetEnv PERL5LIB per vhost basis and it works fine for me
without Apache::Reload.

 Has anybody run across this problem?
 If sowhat is my solution?

SB There are several solutions, none of which is very helpful in 
SB production, since they either slow things down or may cause collisions 
SB when modules with the same names are loaded, see:
SB 
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_

I would like just set PerlInitHandler Apache::Reload on several vhosts
only for developing purposes and preserve everything else at that.

Thanks for advice,
Igor.




@INC + use Lib

2002-11-14 Thread Pierre Smolarek



I've been having problems with use lib. I read the 
extract at http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perland 
realised that you can hardcode @INC via httpd.conf or startup.pl. however, i 
tried adding PerlSetEnv PERL5LIB to a .htaccess file but that doesn't seem to 
work!?

Is there someway to isolate the paths to specific 
virtualhosts or directories? I tried adding it within a directory command in 
httpd.conf but it didn't seem to work.

Am I going about this in the right 
way?

Pierre


Re: @INC + use Lib

2002-11-14 Thread Stas Bekman
Pierre Smolarek wrote:

I've been having problems with use lib. I read the extract at 
http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl and 
realised that you can hardcode INC via httpd.conf or startup.pl. 
however, i tried adding PerlSetEnv PERL5LIB to a .htaccess file but that 
doesn't seem to work!?

INC is hardcoded at the server startup and gets reset after each request.


Is there someway to isolate the paths to specific virtualhosts or 
directories? I tried adding it within a directory command in httpd.conf 
but it didn't seem to work.

Look at:
http://perl.apache.org/docs/1.0/guide/config.html#Is_There_a_Way_to_Modify__INC_on_a_Per_Virtual_Host_or_Per_Location_Basis_
http://perl.apache.org/docs/1.0/guide/modules.html#Apache__PerlVINC___Allows_Module_Versioning_in_Location_blocks_and_Virtual_Hosts

__
Stas BekmanJAm_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




Apache::Reload - patch - fixes problems with using dynamic @INC

2002-10-13 Thread Randy Harmon


I started using a dynamic INC (set up in a TransHandler), and discovered
that Apache::Reload (v0.07) was not doing its job correctly in that case.
Note, changing INC in a transhandler won't have the desired Apache::Reload
effects unless the PerlInitHandler for Apache::Reload is placed in a
Location section of httpd.conf.

The following patch corrects this, though it adds a few extra stat() calls
if the module is found at the end of INC instead of near the beginning (as
mine are).  You could make this behavior an optional one for strange folks
like me :).  Oh, I just added that to the patch manually:

   PerlSetVar ReloadDynamicInc 1

...will enable this INC-scanning behavior.  I think I hacked the patch
correctly :)

Note, if a module is loaded with one INC, then on a subsequent request,
INC changes such that the module would be not-found, the module is not
removed from memory.  If you do that and use it from a script (served when
INC doesn't have the module), you'll get erratic behavior - it'll work fine
sometimes and error out other times.  So don't do that., as a wise man
said.  Instead, make sure INC always has the right libs for your script -
test from a freshly-started server to be sure.

Separate from this strange Dynamic-@INC use case, there's another bug in the
release version of the module: if you moved a module from one INC dir to
another, the INC loop at the top of handler() would not find the file, as
it was looking for inc-dir/full-path-name instead of
inc-dir/relative-path-name.  This patch should fix this too, whether
ReloadDynamicInc is used or not.

I haven't tested this with wildcard settings or ReloadAll.

Enjoy,

Randy


--- Reload.pm   Sat Oct 12 16:22:02 2002
+++ Reload.pm.new   Sat Oct 12 17:08:07 2002
 -108,35 +108,40 

 while (my($key, $file) = each %Apache::Reload::INCS) {
 local $^W;
 warn Apache::Reload: Checking mtime of $key\n if $DEBUG;

 my $mtime = (stat $file)[9];

-unless (defined($mtime)  $mtime) {
-for (INC) {
-$mtime = (stat $_/$file)[9];
-last if defined($mtime)  $mtime;
-}
-}
+
+my $found = $file;
+if( $r-dir_config(ReloadDynamicInc) || !$mtime ) {
+# seek out the file in INC.
+my $mt;
+for (INC) {
+$mt = (stat $_/$key)[9];
+$mtime = $mt, $found = $_/$key, last if defined($mt) 
$mt;
+}
+}
+
 warn(Apache::Reload: Can't locate $file\n),next
 unless defined $mtime and $mtime;

 unless (defined $Stat{$file}) {
 $Stat{$file} = $^T;
 }

-if ($mtime  $Stat{$file}) {
+if( $found ne $file || $mtime  $Stat{$file} ) {
 delete $INC{$key};
 if (my $symref = $UndefFields{$key}) {
 #warn undeffing fields\n;
 no strict 'refs';
 undef %{$symref};




modifying @INC at startup and version of perl used

2002-08-29 Thread Jamie . Echlin

Hi,

This is probably a luser error as I am quite new to this malarkey, however I have been 
experimenting for a while without progress now. I need to know how to find out exactly 
which version of perl mod_perl is configured to use, and if this can be changed as a 
non-root user, and how to set the INC.

I have a simple startup script that prints INC, which prints
INC: /sbcimp/run/pd/perl/5.005_03/lib/sun4-solaris
/sbcimp/run/pd/perl/5.005_03/lib
/sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris
/sbcimp/run/pd/perl/5.005_03/lib/site_perl

this makes me think I am running 5.005_03? 

In the conf file I have 
PerlSetEnv PERL5LIB /sbcimp/run/pd/perl/5.6.1/lib:/sbcimp/run/pd/cpan/5.6.1-2002.06/lib
but this does not seem to update the INC. (I've also tried combinations of PERLLIB 
and SetEnv etc).

When this is set however I get the following errors
Can't locate object method boot via package mod_perl at 
/sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris/Apache/Constants.pm line 8.
and
[Thu Aug 29 10:41:12 2002] [error] syntax error at 
/sbcimp/run/pd/perl/5.6.1/lib/warnings.pm line 306, near {^
syntax error at /sbcimp/run/pd/perl/5.6.1/lib/warnings.pm line 311, near {^

etc, which is making me think I am mixing incompatible perl binaries and modules. 

Does that seem reasonable, and if so what can I do to use perl 5.6.1?

Many thanks for your time.
jamie


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.




Re: modifying @INC at startup and version of perl used

2002-08-29 Thread mmaunder

Jamie,

Use the perl internal variables to figure out what version you're running under: $] 
and $^V
Use these whether you're running perl or mod_perl. You might want to direct questions 
relating to perl in general to the perl beginners list.
Please see perldoc perlvar for more details.

~mark.

On Thu, Aug 29, 2002 at 10:44:15AM +0100, [EMAIL PROTECTED] wrote:
 Hi,
 
 This is probably a luser error as I am quite new to this malarkey, however I have 
been experimenting for a while without progress now. I need to know how to find out 
exactly which version of perl mod_perl is configured to use, and if this can be 
changed as a non-root user, and how to set the @INC.
 
 I have a simple startup script that prints @INC, which prints
 @INC: /sbcimp/run/pd/perl/5.005_03/lib/sun4-solaris
 /sbcimp/run/pd/perl/5.005_03/lib
 /sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris
 /sbcimp/run/pd/perl/5.005_03/lib/site_perl
 
 this makes me think I am running 5.005_03? 
 
 In the conf file I have 
 PerlSetEnv PERL5LIB 
/sbcimp/run/pd/perl/5.6.1/lib:/sbcimp/run/pd/cpan/5.6.1-2002.06/lib
 but this does not seem to update the @INC. (I've also tried combinations of PERLLIB 
and SetEnv etc).
 
 When this is set however I get the following errors
 Can't locate object method boot via package mod_perl at 
/sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris/Apache/Constants.pm line 8.
 and
 [Thu Aug 29 10:41:12 2002] [error] syntax error at 
/sbcimp/run/pd/perl/5.6.1/lib/warnings.pm line 306, near {^
 syntax error at /sbcimp/run/pd/perl/5.6.1/lib/warnings.pm line 311, near {^
 
 etc, which is making me think I am mixing incompatible perl binaries and modules. 
 
 Does that seem reasonable, and if so what can I do to use perl 5.6.1?
 
 Many thanks for your time.
 jamie
 
 
 Visit our website at http://www.ubswarburg.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please 
 notify the sender immediately by e-mail if you have received this 
 e-mail by mistake and delete this e-mail from your system.
 
 E-mail transmission cannot be guaranteed to be secure or error-free 
 as information could be intercepted, corrupted, lost, destroyed, 
 arrive late or incomplete, or contain viruses.  The sender therefore 
 does not accept liability for any errors or omissions in the contents 
 of this message which arise as a result of e-mail transmission.  If 
 verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any securities or 
 related financial instruments.



RE: modifying @INC at startup and version of perl used

2002-08-29 Thread Jamie . Echlin

Thanks, but, didn't think i was a beginner... this is more of a mod_perl question 
because I'm aware of how to set @INC etc for normal perl scripts. Anyway I tried your 
advice, but, from perldoc perlvar:

$]
The use of this variable is deprecated

and for $^V: 
Use of uninitialized value at blah.pl line 7.

So are you forced to use the version of perl that was chosen when mod_perl was 
installed? Guess so, am trying to do a local non-root install of apache and mod_perl 
to see if this is so.

Thanks for the help,
jamie


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2002 11:22
To: Echlin, Jamie
Cc: [EMAIL PROTECTED]
Subject: Re: modifying @INC at startup and version of perl used


Jamie,

Use the perl internal variables to figure out what version 
you're running under: $] and $^V
Use these whether you're running perl or mod_perl. You might 
want to direct questions relating to perl in general to the 
perl beginners list.
Please see perldoc perlvar for more details.

~mark.

On Thu, Aug 29, 2002 at 10:44:15AM +0100, [EMAIL PROTECTED] wrote:
 Hi,
 
 This is probably a luser error as I am quite new to this 
malarkey, however I have been experimenting for a while 
without progress now. I need to know how to find out exactly 
which version of perl mod_perl is configured to use, and if 
this can be changed as a non-root user, and how to set the @INC.
 
 I have a simple startup script that prints @INC, which prints
 @INC: /sbcimp/run/pd/perl/5.005_03/lib/sun4-solaris
 /sbcimp/run/pd/perl/5.005_03/lib
 /sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris
 /sbcimp/run/pd/perl/5.005_03/lib/site_perl
 
 this makes me think I am running 5.005_03? 
 
 In the conf file I have 
 PerlSetEnv PERL5LIB 
/sbcimp/run/pd/perl/5.6.1/lib:/sbcimp/run/pd/cpan/5.6.1-2002.06/lib
 but this does not seem to update the @INC. (I've also tried 
combinations of PERLLIB and SetEnv etc).
 
 When this is set however I get the following errors
 Can't locate object method boot via package mod_perl at 
/sbcimp/run/pd/perl/5.005_03/lib/site_perl/sun4-solaris/Apache/
Constants.pm line 8.
 and
 [Thu Aug 29 10:41:12 2002] [error] syntax error at 
/sbcimp/run/pd/perl/5.6.1/lib/warnings.pm line 306, near {^
 syntax error at /sbcimp/run/pd/perl/5.6.1/lib/warnings.pm 
line 311, near {^
 
 etc, which is making me think I am mixing incompatible perl 
binaries and modules. 
 
 Does that seem reasonable, and if so what can I do to use perl 5.6.1?
 
 Many thanks for your time.
 jamie
 
 
 Visit our website at http://www.ubswarburg.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please 
 notify the sender immediately by e-mail if you have received this 
 e-mail by mistake and delete this e-mail from your system.
 
 E-mail transmission cannot be guaranteed to be secure or error-free 
 as information could be intercepted, corrupted, lost, destroyed, 
 arrive late or incomplete, or contain viruses.  The sender therefore 
 does not accept liability for any errors or omissions in the 
contents 
 of this message which arise as a result of e-mail transmission.  If 
 verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any 
securities or 
 related financial instruments.


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.




Re: modifying @INC at startup and version of perl used

2002-08-29 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
[...]


  So are you forced to use the version of perl that was chosen when
  mod_perl was installed? Guess so, am trying to do a local non-root
  install of apache and mod_perl to see if this is so.

It helps to RTFM:
http://perl.apache.org/docs/1.0/guide/install.html#Should_I_Rebuild_mod_perl_if_I_have_Upgraded_Perl_
http://perl.apache.org/docs/1.0/guide/install.html#Installation_Without_Superuser_Privileges
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




RE: modifying @INC at startup and version of perl used

2002-08-29 Thread Jamie . Echlin

Actually I was in the process of reading your very useful piece on how to create a 
non-root install. Problem is, there is a hell of a lot of FM to read.
anyway, ta

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2002 12:01
To: Echlin, Jamie
Cc: [EMAIL PROTECTED]
Subject: Re: modifying @INC at startup and version of perl used


[EMAIL PROTECTED] wrote:
[...]


  So are you forced to use the version of perl that was chosen when
  mod_perl was installed? Guess so, am trying to do a local non-root
  install of apache and mod_perl to see if this is so.

It helps to RTFM:
http://perl.apache.org/docs/1.0/guide/install.html#Should_I_Reb
uild_mod_perl_if_I_have_Upgraded_Perl_
http://perl.apache.org/docs/1.0/guide/install.html#Installation
_Without_Superuser_Privileges
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.




RE: modifying @INC at startup and version of perl used

2002-08-29 Thread Jesse Erlbaum

Hi Jamie --

 So are you forced to use the version of perl that was chosen when
 mod_perl was installed? Guess so, am trying to do a local
 non-root install of apache and mod_perl to see if this is so.


Yes -- you are bound to use the version of Perl which was compiled into
Apache.  If you want to upgrade Perl it is necessary to re-compile
Apache/mod_perl.

On that note, I have created a mostly-automatic build system to compile
Apache with both mod_perl and mod_ssl.  You can download the Makefile (and
source tarballs, if you need) from here:

http://www.erlbaum.net/Apache-Perl-SSL/


It's pretty raw, but it works for me.  I can build a consistent
Apache/mod_perl/mod_ssl from source, usually with one command:

$ make build

This will also allow you to build as a NON-ROOT user.  It was designed to do
so as a primary function.

Let me know if you find this useful!


Warmest regards,

-Jesse-


--

  Jesse Erlbaum
  The Erlbaum Group
  [EMAIL PROTECTED]
  Phone: 212-684-6161
  Fax: 212-684-6226






@INC

2002-08-29 Thread Ufuk Yuzereroglu



How can I have @INC array contain the directory 
names /usr/lib/perl/5.6.1 ... instead of /usr/lib/5.6.0. Apache does not run 
beacuse of the value of @INC.

UY


RE: @INC

2002-08-29 Thread Jesse Erlbaum

Hi Ufuk --

How can I have INC array contain the directory names 
 /usr/lib/perl/5.6.1 ... instead of /usr/lib/5.6.0. 
 Apache does not run beacuse of the value of INC.

You need to recompile Apache/mod_perl.

-Jesse-




RE: @INC

2002-08-29 Thread Darren Ward

Can't you use the perl startup file to re-write the INC array?

I thought I'd seen a post along those lines a while back.

Darren

-Original Message-
From: Jesse Erlbaum [mailto:[EMAIL PROTECTED]]
Sent: Friday, 30 August 2002 6:29 AM
To: [EMAIL PROTECTED]
Subject: RE: @INC


Hi Ufuk --

How can I have @INC array contain the directory names 
 /usr/lib/perl/5.6.1 ... instead of /usr/lib/5.6.0. 
 Apache does not run beacuse of the value of @INC.

You need to recompile Apache/mod_perl.

-Jesse-



RE: @INC

2002-08-29 Thread Jesse Erlbaum

Hi Darren --

 Can't you use the perl startup file to re-write the INC array?

 I thought I'd seen a post along those lines a while back.


Sure you can.  I use PERL5LIB and an unshift(@INC, ...) all the time to
push an extra path at server startup.

However, that's just the tip of Ufuk's problem.  He is reporting that
mod_perl is compiled with Perl 5.6.0, but he wants to have access to 5.6.1
libraries.  There are pretty big differences between 5.6.0 and 5.6.1.  If
all he wanted to do was access modules in another path that would be easy.
I suspect that even if he got that working he would have a host of
incompatibilities which would necessitate a recompile, anyway.

TTYL,

-Jesse-


--

  Jesse Erlbaum
  The Erlbaum Group
  [EMAIL PROTECTED]
  Phone: 212-684-6161
  Fax: 212-684-6226





@INC

2002-07-29 Thread Ruslan V. Sulakov

My INC contains WRONG directories!!! Help!
How can I change INC in perl for installing of Apache::SubProcess and other
modules?
At this time I cannot install any Apache::* related modules, because of bad
INC

Platform: FreeBSD

I have Apache::* modules installed in:
/usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/

But I cannot install needed modules:
oasis2# tar -zxf Apache-SubProcess-0.03.tar.gz
oasis2# cd Apache-SubProcess-0.03
oasis2# perl Makefile.PL
Can't locate Apache/src.pm in INC (INC contains: ../lib
/usr/libdata/perl/5.00503/mach /
usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/
perl5/site_perl/5.005 .) at Makefile.PL line 4.
BEGIN failed--compilation aborted at Makefile.PL line 4.
oasis2#

Thanks in advance!
Ruslan





Re: @INC

2002-07-29 Thread Ruslan V. Sulakov

Thanks, Ilya! You are right!
/usr/bin/perl contains old binary from v5.00503
So, I've change it to a link pointing to /usr/local/bin/perl
Now all works fine!
Ruslan

 Looks like your sys admin had installed perl from core and from ports
 and as result you have two perl installation on systems. Perl from
 core (5.00503) likely to have is binary in /usr/bin/perl and perl from
 ports (5.6.1) in /usr/local/bin/perl.
 
 If your PATH doesn't have /usr/local/bin or it comes after /usr/bin
 than 'perl Makefile.PL' uses perl from core. Try either changing your
 PATH or using full path to perl (i.e. /usr/local/bin/perl
 Makefile.PL).







Apache::DBI debugging (was: Re: Modifying @INC via startup.pl)

2002-05-20 Thread Per Einar Ellefsen


At 23:36 19.05.2002, Gregory Matthews wrote:
# Initialize the database connections for each child
Apache::DBI-connect_on_init
(DBI:mysql:database=test;host=localhost, user,password,
{ PrintError = 1, # warn() on errors
RaiseError = 0, # don't die on error
AutoCommit = 1, # commit executes immediately }

I am also using the $Apache::DBI::DEBUG = 2; flag to ensure it is working 
properly.

I am NOT seeing the entries in the error_log both when Apache::DBI 
initializes a connection and when it returns one from its cache.

Shouldn't I be able to see a reference to the connection in my error_log 
file?

I checked both my virtual host error_log file and the server error_log 
file. Nothing in either.

When/Where are you setting this flag? I don't have much experience with 
Apache::DBI, so I won't be able to help you much.

You could also try
 DBI-trace(1); #or any other level mentioned in the DBI docs.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





New mod_perl website [Was Re: Modifying @INC via startup.pl]

2002-05-20 Thread Drew Taylor

This is a little OT, but I really love the new look of the website you 
mention below. Major kudos to all those who helped put together the new 
look-n-feel  content.

Drew

At 11:53 PM 5/19/2002 +0200, you wrote:
Thank you very much Gregory, I have patches the online docs.

By the way, the release-ready (almost) site is now at 
http://perl.apache.org/release/

==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




Re: New mod_perl website [Was Re: Modifying @INC via startup.pl]

2002-05-20 Thread Stas Bekman

Drew Taylor wrote:
 This is a little OT, but I really love the new look of the website you 
 mention below. Major kudos to all those who helped put together the new 
 look-n-feel  content.

Thanks Drew, but please hold off on any comments, since we are still 
tuning the design to work better in various browsers. Once we are 
satisfied with it, we will make an announcement and then ask you to 
check if you have any problems with your favorite browsers.

Meanwhile if you are willing to help or want to comment on things, 
please join the [EMAIL PROTECTED] list.  We do need 
your help.

BTW, the final site will be at http://perl.apache.org/.

The http://perl.apache.org/release/ URL is only temporary.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Modifying @INC via startup.pl

2002-05-19 Thread Per Einar Ellefsen

At 02:50 19.05.2002, Gregory Matthews wrote:
Tried that...doesn't work either.

@INC still cannot find my config.pl file.  If I add the use lib statement 
to my script, all is o.k..  If I try to add it to my startup.pl and call 
it at startup time, I get the error from @INC.

Are you sure you are loading your startup.pl file before your module?
Are you sure it's getting loaded at all?
Try adding a debug statement in your startup.pl:

print STDERR 'Loading startup.pl  @INC = ', join :, @INC;

after your use lib part.

At 06:16 PM 5/18/2002 -0400, you wrote:
I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 



-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

I added the below STDER statement and did NOT see the printout either on 
screen or in my error_log file.

It sounds like then my startup.pl file is not even being loaded?  Funny 
though I can deliberately put a bogus module name or misspell use 
stric; and I will be unable to restart the server because of it.  Can 
this file be read and checked for correctness but not loaded?

Gregory

At 09:57 AM 5/19/2002 +0200, you wrote:
At 02:50 19.05.2002, Gregory Matthews wrote:
Tried that...doesn't work either.

@INC still cannot find my config.pl file.  If I add the use lib statement 
to my script, all is o.k..  If I try to add it to my startup.pl and call 
it at startup time, I get the error from @INC.

Are you sure you are loading your startup.pl file before your module?
Are you sure it's getting loaded at all?
Try adding a debug statement in your startup.pl:

print STDERR 'Loading startup.pl  @INC = ', join :, @INC;

after your use lib part.

At 06:16 PM 5/18/2002 -0400, you wrote:
I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 


--
Per Einar Ellefsen
[EMAIL PROTECTED]







Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

If I run apachectl configtest, I can see the below statement, Loading 
startup.pl..., so it appears that it is at least reading it (which I knew 
before), but for some reason, @INC does not show an updated path per my 
call, use lib qw(...); .

In addition, I am using the Apache::DBI module with the 
Apache::DBI-connect_on_init option, and even though I put in bogus 
database info, Apache starts fine with no errors?

Any ideas on what is going on?

Gregory

At 09:57 AM 5/19/2002 +0200, you wrote:
At 02:50 19.05.2002, Gregory Matthews wrote:
Tried that...doesn't work either.

@INC still cannot find my config.pl file.  If I add the use lib statement 
to my script, all is o.k..  If I try to add it to my startup.pl and call 
it at startup time, I get the error from @INC.

Are you sure you are loading your startup.pl file before your module?
Are you sure it's getting loaded at all?
Try adding a debug statement in your startup.pl:

print STDERR 'Loading startup.pl  @INC = ', join :, @INC;

after your use lib part.

At 06:16 PM 5/18/2002 -0400, you wrote:
I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 


--
Per Einar Ellefsen
[EMAIL PROTECTED]







Re: Modifying @INC via startup.pl

2002-05-19 Thread Per Einar Ellefsen

At 18:57 19.05.2002, Gregory Matthews wrote:
I added the below STDER statement and did NOT see the printout either on 
screen or in my error_log file.

It sounds like then my startup.pl file is not even being loaded?  Funny 
though I can deliberately put a bogus module name or misspell use 
stric; and I will be unable to restart the server because of it.  Can 
this file be read and checked for correctness but not loaded?

Wow, now this is weird. Could you try something as simple as

file:startup.pl
--
use lib qw(/path/to/foo);
print STDERR Loading startup.pl;
1;

And then load that with PerlRequire?

Came to think of it: could you try without Apache::DB? Maybe that's the 
source of your problems.

Finally, as a quick fix to your original problem: maybe you can use PERL5LIB:

PerlSetEnv PERL5LIB /path

in your httpd.conf.

This is all I can come up with, sorry.

At 09:57 AM 5/19/2002 +0200, you wrote:
At 02:50 19.05.2002, Gregory Matthews wrote:
Tried that...doesn't work either.

@INC still cannot find my config.pl file.  If I add the use lib 
statement to my script, all is o.k..  If I try to add it to my 
startup.pl and call it at startup time, I get the error from @INC.

Are you sure you are loading your startup.pl file before your module?
Are you sure it's getting loaded at all?
Try adding a debug statement in your startup.pl:

print STDERR 'Loading startup.pl  @INC = ', join :, @INC;

after your use lib part.

At 06:16 PM 5/18/2002 -0400, you wrote:
I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way 
to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 

--
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

Tom:

No, same error_log as usual.  I think this problem may have something to do 
with my host. I am on a virtual private server, not dedicated, although, 
I do have root access.

The way they configure the servers load in a portion of the mod_perl 
directives before my Location block, i.e., my vhosts.conf call looks like this:

# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1 frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Location /perl
   PerlFixupHandler  Apache::DB
   SetHandler   perl-script
   PerlHandler   Apache::Registry
   OptionsExecCGI
   allow from all
   PerlSendHeaderOff
/Location
# end mod_perl setup

Notice that I do NOT need to call PerlModule Apache::Registry.  It is 
already loaded.

I may give up on the startup.pl file and simply add a Perl.../Perl 
section directly. Will this solve the problem?

Gregory

At 11:40 AM 5/19/2002 -0700, you wrote:


Gregory, are you _sure_ you have the right error_log ? You didn't send
mod_perl errors somewhere different from normal? That is my most common
reason for not being able to find diagnostic messages... (looking in the
normal webserver logs, or the ssl logs, as compared to the mod_perl
daemon's error logs)

On Sun, 19 May 2002, Per Einar Ellefsen wrote:

  At 18:57 19.05.2002, Gregory Matthews wrote:
  I added the below STDER statement and did NOT see the printout either on
  screen or in my error_log file.
  
  It sounds like then my startup.pl file is not even being loaded?  Funny
  though I can deliberately put a bogus module name or misspell use
  stric; and I will be unable to restart the server because of it.  Can
  this file be read and checked for correctness but not loaded?
 
  Wow, now this is weird. Could you try something as simple as
 
  file:startup.pl
  --
  use lib qw(/path/to/foo);
  print STDERR Loading startup.pl;
  1;
 
  And then load that with PerlRequire?
 
  Came to think of it: could you try without Apache::DB? Maybe that's the
  source of your problems.
 
  Finally, as a quick fix to your original problem: maybe you can use 
 PERL5LIB:
 
  PerlSetEnv PERL5LIB /path
 
  in your httpd.conf.
 
  This is all I can come up with, sorry.
 
  At 09:57 AM 5/19/2002 +0200, you wrote:
  At 02:50 19.05.2002, Gregory Matthews wrote:
  Tried that...doesn't work either.
  
  @INC still cannot find my config.pl file.  If I add the use lib
  statement to my script, all is o.k..  If I try to add it to my
  startup.pl and call it at startup time, I get the error from @INC.
  
  Are you sure you are loading your startup.pl file before your module?
  Are you sure it's getting loaded at all?
  Try adding a debug statement in your startup.pl:
  
  print STDERR 'Loading startup.pl  @INC = ', join :, @INC;
  
  after your use lib part.
  
  At 06:16 PM 5/18/2002 -0400, you wrote:
  I did this:
  
  use lib qw(path to files);
  
  That adds the path to @INC. Someone correct me if that's the wrong way
  to do
  things
  
  - Original Message -
  From: Gregory Matthews [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, May 18, 2002 6:12 PM
  Subject: Modifying @INC via startup.pl
  
  
I am trying to:
   
use lib qw(/dir/foo);
   
in my startup.pl file but @INC is NOT showing the path. I keep 
 getting
Can't locate config.pl in @INC errors after restarting the 
 server and
calling the script.
   
My prog reads:
   
require qq(config.pl);
   
I am not sure what is going on. @INC shows:
   
(@INC contains: /usr/libdata/perl/5.00503/mach 
 /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
/usr/local/www/lib/perl) at (eval 265) line 22.
   
Why is the path to config.pl not showing up?  My defaults.conf 
 reads:
   
# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
  frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Directory /usr/local/www/vhosts/host.com/perl
   PerlFixupHandler  +Apache::DB
   SetHandler perl-script
   PerlHandler   +Apache::Registry
   Options   +ExecCGI
   allow from all
   PerlSendHeader Off
/Directory
# end mod_perl setup
   
Thanks everyone.  This list is a lifesaver!
   
Gregory
   
   
   
   
  
  --
  Per Einar Ellefsen
  [EMAIL PROTECTED]
 
 


--
[EMAIL PROTECTED]   | What I like about deadlines is the lovely
http://BareMetal.com/  | whooshing they make as they rush past.
web hosting since '95  | - Douglas Adams





Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

Tom:

Fixed it.  I needed to add a 1; to the end of my startup.pl file. I was 
using a startup.pl file example from apache.org which did NOT have this. 
Then in doing some research, found out that it needed it.  Now the @INC is 
being updated at startup.

Thanks for your help!

Gregory

At 11:40 AM 5/19/2002 -0700, you wrote:


Gregory, are you _sure_ you have the right error_log ? You didn't send
mod_perl errors somewhere different from normal? That is my most common
reason for not being able to find diagnostic messages... (looking in the
normal webserver logs, or the ssl logs, as compared to the mod_perl
daemon's error logs)

On Sun, 19 May 2002, Per Einar Ellefsen wrote:

  At 18:57 19.05.2002, Gregory Matthews wrote:
  I added the below STDER statement and did NOT see the printout either on
  screen or in my error_log file.
  
  It sounds like then my startup.pl file is not even being loaded?  Funny
  though I can deliberately put a bogus module name or misspell use
  stric; and I will be unable to restart the server because of it.  Can
  this file be read and checked for correctness but not loaded?
 
  Wow, now this is weird. Could you try something as simple as
 
  file:startup.pl
  --
  use lib qw(/path/to/foo);
  print STDERR Loading startup.pl;
  1;
 
  And then load that with PerlRequire?
 
  Came to think of it: could you try without Apache::DB? Maybe that's the
  source of your problems.
 
  Finally, as a quick fix to your original problem: maybe you can use 
 PERL5LIB:
 
  PerlSetEnv PERL5LIB /path
 
  in your httpd.conf.
 
  This is all I can come up with, sorry.
 
  At 09:57 AM 5/19/2002 +0200, you wrote:
  At 02:50 19.05.2002, Gregory Matthews wrote:
  Tried that...doesn't work either.
  
  @INC still cannot find my config.pl file.  If I add the use lib
  statement to my script, all is o.k..  If I try to add it to my
  startup.pl and call it at startup time, I get the error from @INC.
  
  Are you sure you are loading your startup.pl file before your module?
  Are you sure it's getting loaded at all?
  Try adding a debug statement in your startup.pl:
  
  print STDERR 'Loading startup.pl  @INC = ', join :, @INC;
  
  after your use lib part.
  
  At 06:16 PM 5/18/2002 -0400, you wrote:
  I did this:
  
  use lib qw(path to files);
  
  That adds the path to @INC. Someone correct me if that's the wrong way
  to do
  things
  
  - Original Message -
  From: Gregory Matthews [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, May 18, 2002 6:12 PM
  Subject: Modifying @INC via startup.pl
  
  
I am trying to:
   
use lib qw(/dir/foo);
   
in my startup.pl file but @INC is NOT showing the path. I keep 
 getting
Can't locate config.pl in @INC errors after restarting the 
 server and
calling the script.
   
My prog reads:
   
require qq(config.pl);
   
I am not sure what is going on. @INC shows:
   
(@INC contains: /usr/libdata/perl/5.00503/mach 
 /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
/usr/local/www/lib/perl) at (eval 265) line 22.
   
Why is the path to config.pl not showing up?  My defaults.conf 
 reads:
   
# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
  frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Directory /usr/local/www/vhosts/host.com/perl
   PerlFixupHandler  +Apache::DB
   SetHandler perl-script
   PerlHandler   +Apache::Registry
   Options   +ExecCGI
   allow from all
   PerlSendHeader Off
/Directory
# end mod_perl setup
   
Thanks everyone.  This list is a lifesaver!
   
Gregory
   
   
   
   
  
  --
  Per Einar Ellefsen
  [EMAIL PROTECTED]
 
 


--
[EMAIL PROTECTED]   | What I like about deadlines is the lovely
http://BareMetal.com/  | whooshing they make as they rush past.
web hosting since '95  | - Douglas Adams





Re: Modifying @INC via startup.pl

2002-05-19 Thread Per Einar Ellefsen

At 22:03 19.05.2002, Gregory Matthews wrote:
Tom:

Fixed it.  I needed to add a 1; to the end of my startup.pl file. I was 
using a startup.pl file example from apache.org which did NOT have this. 
Then in doing some research, found out that it needed it.  Now the @INC is 
being updated at startup.

:)

Would you mind telling us which exaple it was so that we can fix it?

At 11:40 AM 5/19/2002 -0700, you wrote:


Gregory, are you _sure_ you have the right error_log ? You didn't send
mod_perl errors somewhere different from normal? That is my most common
reason for not being able to find diagnostic messages... (looking in the
normal webserver logs, or the ssl logs, as compared to the mod_perl
daemon's error logs)

On Sun, 19 May 2002, Per Einar Ellefsen wrote:

  At 18:57 19.05.2002, Gregory Matthews wrote:
  I added the below STDER statement and did NOT see the printout either on
  screen or in my error_log file.
  
  It sounds like then my startup.pl file is not even being loaded?  Funny
  though I can deliberately put a bogus module name or misspell use
  stric; and I will be unable to restart the server because of it.  Can
  this file be read and checked for correctness but not loaded?
 
  Wow, now this is weird. Could you try something as simple as
 
  file:startup.pl
  --
  use lib qw(/path/to/foo);
  print STDERR Loading startup.pl;
  1;
 
  And then load that with PerlRequire?
 
  Came to think of it: could you try without Apache::DB? Maybe that's the
  source of your problems.
 
  Finally, as a quick fix to your original problem: maybe you can use 
 PERL5LIB:
 
  PerlSetEnv PERL5LIB /path
 
  in your httpd.conf.
 
  This is all I can come up with, sorry.
 
  At 09:57 AM 5/19/2002 +0200, you wrote:
  At 02:50 19.05.2002, Gregory Matthews wrote:
  Tried that...doesn't work either.
  
  @INC still cannot find my config.pl file.  If I add the use lib
  statement to my script, all is o.k..  If I try to add it to my
  startup.pl and call it at startup time, I get the error from @INC.
  
  Are you sure you are loading your startup.pl file before your module?
  Are you sure it's getting loaded at all?
  Try adding a debug statement in your startup.pl:
  
  print STDERR 'Loading startup.pl  @INC = ', join :, @INC;
  
  after your use lib part.
  
  At 06:16 PM 5/18/2002 -0400, you wrote:
  I did this:
  
  use lib qw(path to files);
  
  That adds the path to @INC. Someone correct me if that's the wrong way
  to do
  things
  
  - Original Message -
  From: Gregory Matthews [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, May 18, 2002 6:12 PM
  Subject: Modifying @INC via startup.pl
  
  
I am trying to:
   
use lib qw(/dir/foo);
   
in my startup.pl file but @INC is NOT showing the path. I keep 
 getting
Can't locate config.pl in @INC errors after restarting the 
 server and
calling the script.
   
My prog reads:
   
require qq(config.pl);
   
I am not sure what is going on. @INC shows:
   
(@INC contains: /usr/libdata/perl/5.00503/mach 
 /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
/usr/local/www/lib/perl) at (eval 265) line 22.
   
Why is the path to config.pl not showing up?  My defaults.conf 
 reads:
   
# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
  frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Directory /usr/local/www/vhosts/host.com/perl
   PerlFixupHandler  +Apache::DB
   SetHandler perl-script
   PerlHandler   +Apache::Registry
   Options   +ExecCGI
   allow from all
   PerlSendHeader Off
/Directory
# end mod_perl setup
   
Thanks everyone.  This list is a lifesaver!
   
Gregory
   
   
   
   
  
  --
  Per Einar Ellefsen
  [EMAIL PROTECTED]
 
 


--
[EMAIL PROTECTED]   | What I like about deadlines is the lovely
http://BareMetal.com/  | whooshing they make as they rush past.
web hosting since '95  | - Douglas Adams



-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

Tom:

Here is one of them. I think that I saw it elsewhere also.  When I come 
across the other pages, I will advise.

http://perl.apache.org/preview/modperl-site-ok/docs/1.0/guide/config.html#MinSpareServers_MaxSpareServers_StartServers_MaxClients_MaxRequestsPerChild

Thanks again Tom!

Also, here is another question:  I am putting the following in my startup 
file to initialize a db connection:

# Initialize the database connections for each child
Apache::DBI-connect_on_init
(DBI:mysql:database=test;host=localhost, user,password,
{ PrintError = 1, # warn() on errors
RaiseError = 0, # don't die on error
AutoCommit = 1, # commit executes immediately }

I am also using the $Apache::DBI::DEBUG = 2; flag to ensure it is working 
properly.

I am NOT seeing the entries in the error_log both when Apache::DBI 
initializes a connection and when it returns one from its cache.

Shouldn't I be able to see a reference to the connection in my error_log file?

I checked both my virtual host error_log file and the server error_log 
file. Nothing in either.

Gregory




At 10:21 PM 5/19/2002 +0200, you wrote:
At 22:03 19.05.2002, Gregory Matthews wrote:
Tom:

Fixed it.  I needed to add a 1; to the end of my startup.pl file. I was 
using a startup.pl file example from apache.org which did NOT have this. 
Then in doing some research, found out that it needed it.  Now the @INC 
is being updated at startup.

:)

Would you mind telling us which exaple it was so that we can fix it?

At 11:40 AM 5/19/2002 -0700, you wrote:


Gregory, are you _sure_ you have the right error_log ? You didn't send
mod_perl errors somewhere different from normal? That is my most common
reason for not being able to find diagnostic messages... (looking in the
normal webserver logs, or the ssl logs, as compared to the mod_perl
daemon's error logs)

On Sun, 19 May 2002, Per Einar Ellefsen wrote:

  At 18:57 19.05.2002, Gregory Matthews wrote:
  I added the below STDER statement and did NOT see the printout either on
  screen or in my error_log file.
  
  It sounds like then my startup.pl file is not even being loaded?  Funny
  though I can deliberately put a bogus module name or misspell use
  stric; and I will be unable to restart the server because of 
 it.  Can
  this file be read and checked for correctness but not loaded?
 
  Wow, now this is weird. Could you try something as simple as
 
  file:startup.pl
  --
  use lib qw(/path/to/foo);
  print STDERR Loading startup.pl;
  1;
 
  And then load that with PerlRequire?
 
  Came to think of it: could you try without Apache::DB? Maybe that's the
  source of your problems.
 
  Finally, as a quick fix to your original problem: maybe you can use 
 PERL5LIB:
 
  PerlSetEnv PERL5LIB /path
 
  in your httpd.conf.
 
  This is all I can come up with, sorry.
 
  At 09:57 AM 5/19/2002 +0200, you wrote:
  At 02:50 19.05.2002, Gregory Matthews wrote:
  Tried that...doesn't work either.
  
  @INC still cannot find my config.pl file.  If I add the use lib
  statement to my script, all is o.k..  If I try to add it to my
  startup.pl and call it at startup time, I get the error from @INC.
  
  Are you sure you are loading your startup.pl file before your module?
  Are you sure it's getting loaded at all?
  Try adding a debug statement in your startup.pl:
  
  print STDERR 'Loading startup.pl  @INC = ', join :, @INC;
  
  after your use lib part.
  
  At 06:16 PM 5/18/2002 -0400, you wrote:
  I did this:
  
  use lib qw(path to files);
  
  That adds the path to @INC. Someone correct me if that's the 
 wrong way
  to do
  things
  
  - Original Message -
  From: Gregory Matthews [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, May 18, 2002 6:12 PM
  Subject: Modifying @INC via startup.pl
  
  
I am trying to:
   
use lib qw(/dir/foo);
   
in my startup.pl file but @INC is NOT showing the path. I keep 
 getting
Can't locate config.pl in @INC errors after restarting the 
 server and
calling the script.
   
My prog reads:
   
require qq(config.pl);
   
I am not sure what is going on. @INC shows:
   
(@INC contains: /usr/libdata/perl/5.00503/mach 
 /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
/usr/local/www/lib/perl) at (eval 265) line 22.
   
Why is the path to config.pl not showing up?  My defaults.conf 
 reads:
   
# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
  frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Directory /usr/local/www/vhosts/host.com/perl
   PerlFixupHandler  +Apache::DB
   SetHandler perl-script
   PerlHandler   +Apache::Registry
   Options   +ExecCGI
   allow from all

Re: Modifying @INC via startup.pl

2002-05-19 Thread Gregory Matthews

Thanks for the update!

Did you get a chance to review the other question I had below?

Gregory

At 11:53 PM 5/19/2002 +0200, you wrote:

Thank you very much Gregory, I have patches the online docs.

By the way, the release-ready (almost) site is now at 
http://perl.apache.org/release/


At 23:36 19.05.2002, Gregory Matthews wrote:
Tom:

Here is one of them. I think that I saw it elsewhere also.  When I come 
across the other pages, I will advise.

http://perl.apache.org/preview/modperl-site-ok/docs/1.0/guide/config.html#MinSpareServers_MaxSpareServers_StartServers_MaxClients_MaxRequestsPerChild

Thanks again Tom!

Also, here is another question:  I am putting the following in my startup 
file to initialize a db connection:

# Initialize the database connections for each child
Apache::DBI-connect_on_init
(DBI:mysql:database=test;host=localhost, user,password,
{ PrintError = 1, # warn() on errors
RaiseError = 0, # don't die on error
AutoCommit = 1, # commit executes immediately }

I am also using the $Apache::DBI::DEBUG = 2; flag to ensure it is working 
properly.

I am NOT seeing the entries in the error_log both when Apache::DBI 
initializes a connection and when it returns one from its cache.

Shouldn't I be able to see a reference to the connection in my error_log 
file?

I checked both my virtual host error_log file and the server error_log 
file. Nothing in either.

Gregory




At 10:21 PM 5/19/2002 +0200, you wrote:
At 22:03 19.05.2002, Gregory Matthews wrote:
Tom:

Fixed it.  I needed to add a 1; to the end of my startup.pl file. I was 
using a startup.pl file example from apache.org which did NOT have 
this. Then in doing some research, found out that it needed it.  Now 
the @INC is being updated at startup.

:)

Would you mind telling us which exaple it was so that we can fix it?

At 11:40 AM 5/19/2002 -0700, you wrote:


Gregory, are you _sure_ you have the right error_log ? You didn't send
mod_perl errors somewhere different from normal? That is my most common
reason for not being able to find diagnostic messages... (looking in the
normal webserver logs, or the ssl logs, as compared to the mod_perl
daemon's error logs)

On Sun, 19 May 2002, Per Einar Ellefsen wrote:

  At 18:57 19.05.2002, Gregory Matthews wrote:
  I added the below STDER statement and did NOT see the printout 
 either on
  screen or in my error_log file.
  
  It sounds like then my startup.pl file is not even being 
 loaded?  Funny
  though I can deliberately put a bogus module name or misspell use
  stric; and I will be unable to restart the server because of 
 it.  Can
  this file be read and checked for correctness but not loaded?
 
  Wow, now this is weird. Could you try something as simple as
 
  file:startup.pl
  --
  use lib qw(/path/to/foo);
  print STDERR Loading startup.pl;
  1;
 
  And then load that with PerlRequire?
 
  Came to think of it: could you try without Apache::DB? Maybe that's the
  source of your problems.
 
  Finally, as a quick fix to your original problem: maybe you can use 
 PERL5LIB:
 
  PerlSetEnv PERL5LIB /path
 
  in your httpd.conf.
 
  This is all I can come up with, sorry.
 
  At 09:57 AM 5/19/2002 +0200, you wrote:
  At 02:50 19.05.2002, Gregory Matthews wrote:
  Tried that...doesn't work either.
  
  @INC still cannot find my config.pl file.  If I add the use lib
  statement to my script, all is o.k..  If I try to add it to my
  startup.pl and call it at startup time, I get the error from @INC.
  
  Are you sure you are loading your startup.pl file before your module?
  Are you sure it's getting loaded at all?
  Try adding a debug statement in your startup.pl:
  
  print STDERR 'Loading startup.pl  @INC = ', join :, @INC;
  
  after your use lib part.
  
  At 06:16 PM 5/18/2002 -0400, you wrote:
  I did this:
  
  use lib qw(path to files);
  
  That adds the path to @INC. Someone correct me if that's the 
 wrong way
  to do
  things
  
  - Original Message -
  From: Gregory Matthews [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, May 18, 2002 6:12 PM
  Subject: Modifying @INC via startup.pl
  
  
I am trying to:
   
use lib qw(/dir/foo);
   
in my startup.pl file but @INC is NOT showing the path. I 
 keep getting
Can't locate config.pl in @INC errors after restarting the 
 server and
calling the script.
   
My prog reads:
   
require qq(config.pl);
   
I am not sure what is going on. @INC shows:
   
(@INC contains: /usr/libdata/perl/5.00503/mach 
 /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
/usr/local/www/lib/perl) at (eval 265) line 22.
   
Why is the path to config.pl not showing up?  My 
 defaults.conf reads:
   
# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp

Modifying @INC via startup.pl

2002-05-18 Thread Gregory Matthews

I am trying to:

use lib qw(/dir/foo);

in my startup.pl file but INC is NOT showing the path. I keep getting 
Can't locate config.pl in INC errors after restarting the server and 
calling the script.

My prog reads:

require qq(config.pl);

I am not sure what is going on. INC shows:

(INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd 
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/ 
/usr/local/www/lib/perl) at (eval 265) line 22.

Why is the path to config.pl not showing up?  My defaults.conf reads:

# mod_perl setup
Alias /perl /usr/local/www/vhosts/host.com/perl
PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1 frame=2
PerlModule Apache::DB
PerlWarn On
PerlTaintCheck On
Directory /usr/local/www/vhosts/host.com/perl
   PerlFixupHandler  +Apache::DB
   SetHandler perl-script
   PerlHandler   +Apache::Registry
   Options   +ExecCGI
   allow from all
   PerlSendHeader Off
/Directory
# end mod_perl setup

Thanks everyone.  This list is a lifesaver!

Gregory






Re: Modifying @INC via startup.pl

2002-05-18 Thread Jaberwocky

I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


 I am trying to:

 use lib qw(/dir/foo);

 in my startup.pl file but @INC is NOT showing the path. I keep getting
 Can't locate config.pl in @INC errors after restarting the server and
 calling the script.

 My prog reads:

 require qq(config.pl);

 I am not sure what is going on. @INC shows:

 (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
 /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
 /usr/local/www/lib/perl) at (eval 265) line 22.

 Why is the path to config.pl not showing up?  My defaults.conf reads:

 # mod_perl setup
 Alias /perl /usr/local/www/vhosts/host.com/perl
 PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
 PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
 PerlModule Apache::DB
 PerlWarn On
 PerlTaintCheck On
 Directory /usr/local/www/vhosts/host.com/perl
PerlFixupHandler  +Apache::DB
SetHandler perl-script
PerlHandler   +Apache::Registry
Options   +ExecCGI
allow from all
PerlSendHeader Off
 /Directory
 # end mod_perl setup

 Thanks everyone.  This list is a lifesaver!

 Gregory







Re: Modifying @INC via startup.pl

2002-05-18 Thread Gregory Matthews

Tried that...doesn't work either.

@INC still cannot find my config.pl file.  If I add the use lib statement 
to my script, all is o.k..  If I try to add it to my startup.pl and call it 
at startup time, I get the error from @INC.



At 06:16 PM 5/18/2002 -0400, you wrote:
I did this:

use lib qw(path to files);

That adds the path to @INC. Someone correct me if that's the wrong way to do
things

- Original Message -
From: Gregory Matthews [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 18, 2002 6:12 PM
Subject: Modifying @INC via startup.pl


  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 





Re: Modifying @INC via startup.pl

2002-05-18 Thread PinkFreud

Perhaps this might work:

BEGIN {
  use lib qw(/dir/foo);
}

On Sat, May 18, 2002 at 07:50:01PM -0500, Gregory Matthews babbled thus:
 X-Mailer: QUALCOMM Windows Eudora Version 5.1
 Date: Sat, 18 May 2002 19:50:01 -0500
 To: Jaberwocky [EMAIL PROTECTED]
 From: Gregory Matthews [EMAIL PROTECTED]
 Subject: Re: Modifying @INC via startup.pl
 Cc: [EMAIL PROTECTED]
 
 Tried that...doesn't work either.
 
 @INC still cannot find my config.pl file.  If I add the use lib statement 
 to my script, all is o.k..  If I try to add it to my startup.pl and call it 
 at startup time, I get the error from @INC.
 
 
 
 At 06:16 PM 5/18/2002 -0400, you wrote:
 I did this:
 
 use lib qw(path to files);
 
 That adds the path to @INC. Someone correct me if that's the wrong way to 
 do
 things
 
 - Original Message -
 From: Gregory Matthews [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, May 18, 2002 6:12 PM
 Subject: Modifying @INC via startup.pl
 
 
  I am trying to:
 
  use lib qw(/dir/foo);
 
  in my startup.pl file but @INC is NOT showing the path. I keep getting
  Can't locate config.pl in @INC errors after restarting the server and
  calling the script.
 
  My prog reads:
 
  require qq(config.pl);
 
  I am not sure what is going on. @INC shows:
 
  (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503
  /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.005 . /usr/local/www/
  /usr/local/www/lib/perl) at (eval 265) line 22.
 
  Why is the path to config.pl not showing up?  My defaults.conf reads:
 
  # mod_perl setup
  Alias /perl /usr/local/www/vhosts/host.com/perl
  PerlRequire /usr/local/www/vhosts/host.com/perl/libs/startup.pl
  PerlSetEnv PERLDB_OPTS NonStop=1 LineInfo=/tmp/db.out AutoTrace=1
 frame=2
  PerlModule Apache::DB
  PerlWarn On
  PerlTaintCheck On
  Directory /usr/local/www/vhosts/host.com/perl
 PerlFixupHandler  +Apache::DB
 SetHandler perl-script
 PerlHandler   +Apache::Registry
 Options   +ExecCGI
 allow from all
 PerlSendHeader Off
  /Directory
  # end mod_perl setup
 
  Thanks everyone.  This list is a lifesaver!
 
  Gregory
 
 
 
 
 
 

-- 

Mike Edwards

Brainbench certified Master Linux Administrator
http://www.brainbench.com/transcript.jsp?pid=158188
---
Unsolicited advertisments to this address are not welcome.



PerlVINC and Can't locate Foo.pm in @INC ...

2002-05-10 Thread Aaron J Mackey


Banging my head against the wall a bit, 'cause this is just so simple, but
still not working:

Versions: Apache 1.3.22, mod_perl 1.26, perl 5.6.1

relevant lines from httpd.conf:

  PerlWarn On
  PerlModule Apache::PerlVINC

  Location /dat-ajm6q
SetHandler  perl-script
PerlHandler DAT::Client::WWW

PerlINC /home/ajm6q/cvs/dat-head/lib
PerlFixupHandlerApache::PerlVINC
PerlVersion DAT/Client/WWW.pm
  /Location

Error log when access is attempted (other standard directories edited out
for brevity):

[Fri May 10 13:39:39 2002] [error] Can't locate DAT/Client/WWW.pm in INC
(INC contains: /home/ajm6q/cvs/dat-head/lib [... edited out ...]) at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/PerlVINC.pm line 55.

The file is, of course, actually there:

% ls -l /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
-rwxrwxr-x1 ajm6qwebwork   394 May 10 12:40 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm


What am I missing?

thanks for any help,

-Aaron




Re: PerlVINC and Can't locate Foo.pm in @INC ...

2002-05-10 Thread Stas Bekman

Aaron J Mackey wrote:
 Banging my head against the wall a bit, 'cause this is just so simple, but
 still not working:
 
 Versions: Apache 1.3.22, mod_perl 1.26, perl 5.6.1
 
 relevant lines from httpd.conf:
 
   PerlWarn On
   PerlModule Apache::PerlVINC
 
   Location /dat-ajm6q
 SetHandler  perl-script
 PerlHandler DAT::Client::WWW
 
 PerlINC /home/ajm6q/cvs/dat-head/lib
 PerlFixupHandlerApache::PerlVINC
 PerlVersion DAT/Client/WWW.pm
   /Location
 
 Error log when access is attempted (other standard directories edited out
 for brevity):
 
 [Fri May 10 13:39:39 2002] [error] Can't locate DAT/Client/WWW.pm in @INC
 (@INC contains: /home/ajm6q/cvs/dat-head/lib [... edited out ...]) at
 /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/PerlVINC.pm line 55.
 
 The file is, of course, actually there:
 
 % ls -l /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
 -rwxrwxr-x1 ajm6qwebwork   394 May 10 12:40 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
 
 
 What am I missing?

Does it normally work? (without Apache::PerlVINC)

It's possible that you have wrong permissions on one of the segments of 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm so it cannot read the 
final path.

First test simply with:

die $! unless -r /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Ordering in %INC for PerlRestart

2002-04-10 Thread Sreeji K Das

Hi Perrin/Ged,

Thanx for the reply (I hardly get replies for subjects
with restart :-( I guess I'm the only one using
PerlFreshRestart (sic !).

My requirement is to do a neat kill of children and
then do a complete restart. I don't want any existing
connections to be terminated abruptly. Also I want a
complete restart (ie. any modified files should be
loaded - using Apache::Reload/StatINC does a lot of
stat()'s  further each children would get a separate
copy).
Restart was working perfectly until mod_perl-1.19.
After that a lot has changed. Now I have fixed a lot
in mod_perl to get Restart fully working.

Sreeji


 --- Perrin Harkins [EMAIL PROTECTED] wrote:  Ged
Haywood wrote:
  Hi there,
  
  On Tue, 2 Apr 2002, [iso-8859-1] Sreeji K Das
 wrote:
  
  
 I use PerlFreshRestart on to reload my modules.
  
  [snip]
  
 However, here my modules are getting loaded before
 the
 PerlRequire'd is loaded (since %INC is a hash).
 
 First, can some1 suggest a solution for this ?
  
  
  I always stop (with SIGTERM) and start my servers
 rather than using
  restart (SIGUSR1) as I find that there are fewer
 surprises.  I think
  that Perrin will agree.  There are very few
 systems that can't cope
  with a few seconds of downtime.
 
 It's certainly a lot safer, and it won't trash your
 shared memory the 
 way PerlFreshRestart will.
 
 - Perrin
  

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Re: Ordering in %INC for PerlRestart

2002-04-10 Thread Perrin Harkins

Sreeji K Das wrote:
 Thanx for the reply (I hardly get replies for subjects
 with restart :-( I guess I'm the only one using
 PerlFreshRestart (sic !).

Hopefully you are the only one!

 My requirement is to do a neat kill of children and
 then do a complete restart. I don't want any existing
 connections to be terminated abruptly.

I've done this in a load-balanced cluster by stopping all traffic to the 
machine I want to restart, allowing current requests to finish, and then 
restarting it.  It would be nice to have a graceful shutdown option 
though.

 Also I want a
 complete restart (ie. any modified files should be
 loaded - using Apache::Reload/StatINC does a lot of
 stat()'s  further each children would get a separate
 copy).

I could be wrong, but I'm pretty sure PerlFreshRestart will not result 
in as much shared memory as an actual restart.  How does your shared 
memory look after a clean restart vs. a PerlFreshRestart?

 Restart was working perfectly until mod_perl-1.19.

Maybe for you.  For many people it resulted in unexplained segfaults and 
closure problems in CPAN modules.  It's just not a very safe thing to do.

 After that a lot has changed. Now I have fixed a lot
 in mod_perl to get Restart fully working.

You can send your patches to the dev list.  However, most effort is 
focused on getting mod_perl 2 out right now.

- Perrin




Re: Ordering in %INC for PerlRestart

2002-04-10 Thread Fran Fabrizio


 Thanx for the reply (I hardly get replies for subjects
 with restart :-( I guess I'm the only one using
 PerlFreshRestart (sic !).
 
 
 Hopefully you are the only one!

Pardon my newbie-ness, but can someone explain the perils of 
PerlFreshRestart in a bit more depth?  I hadn't heard of it being 
dangerous until now.

Thanks,
Fran




Re: Ordering in %INC for PerlRestart

2002-04-10 Thread Geoffrey Young

Fran Fabrizio wrote:
 
  Thanx for the reply (I hardly get replies for subjects
  with restart :-( I guess I'm the only one using
  PerlFreshRestart (sic !).
 
 
  Hopefully you are the only one!
 
 Pardon my newbie-ness, but can someone explain the perils of
 PerlFreshRestart in a bit more depth?  I hadn't heard of it being
 dangerous until now.

http://perl.apache.org/guide/troubleshooting.html#Evil_things_might_happen_when_us

is a good place to start, and searching the archives will yield a bit more, but 
Perrin's
description in the previous post pretty much sums it up.

HTH

--Geoff



Re: Ordering in %INC for PerlRestart

2002-04-08 Thread Perrin Harkins

Ged Haywood wrote:
 Hi there,
 
 On Tue, 2 Apr 2002, [iso-8859-1] Sreeji K Das wrote:
 
 
I use PerlFreshRestart on to reload my modules.
 
 [snip]
 
However, here my modules are getting loaded before the
PerlRequire'd is loaded (since %INC is a hash).

First, can some1 suggest a solution for this ?
 
 
 I always stop (with SIGTERM) and start my servers rather than using
 restart (SIGUSR1) as I find that there are fewer surprises.  I think
 that Perrin will agree.  There are very few systems that can't cope
 with a few seconds of downtime.

It's certainly a lot safer, and it won't trash your shared memory the 
way PerlFreshRestart will.

- Perrin




Re: Ordering in %INC for PerlRestart

2002-04-07 Thread Ged Haywood

Hi there,

On Tue, 2 Apr 2002, [iso-8859-1] Sreeji K Das wrote:

 I use PerlFreshRestart on to reload my modules.
[snip]
 However, here my modules are getting loaded before the
 PerlRequire'd is loaded (since %INC is a hash).
 
 First, can some1 suggest a solution for this ?

I always stop (with SIGTERM) and start my servers rather than using
restart (SIGUSR1) as I find that there are fewer surprises.  I think
that Perrin will agree.  There are very few systems that can't cope
with a few seconds of downtime.

73,
Ged.





Ordering in %INC for PerlRestart

2002-04-01 Thread Sreeji K Das

Hi
I use PerlFreshRestart on to reload my modules. This
is the problem I face:
I have
PerlRequire bin/startup.pl

which requires a lot of perl modules. However, on
restart (kill USR1), mod_perl does something like:
%temp = %INC; %INC = ();
while (($k, $v) = each %temp)) { require $k; }

However, here my modules are getting loaded before the
PerlRequire'd is loaded (since %INC is a hash).

First, can some1 suggest a solution for this ?

I'd like to have the PerlRequire modules to load first
before the other modules.
One solution I could think of is to modify
perl_reload_inc() in perl_util.c to load
cls-PerlRequire, before loading anything else.

However, I find that cls-PerlRequire-nelts = 0,
eventhough it's  0 in perl_starup() in mod_perl.c.
Any clues as to why it's getting reset in
perl_reload_inc ??

Thanx for any suggestions.

Sreeji
(BTW, the same setup works w/o a problem in
mod_perl-1.19 using perl-5.005. Somehow, ordering of
%INC seems to be different in perl-5.6.1)

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Re: @INC Not exported in older perl's?

2002-02-20 Thread Stas Bekman

Elizabeth Barham wrote:
 Hi,
 
 I have been developing a web application using Apache and mod_perl. It
 consists of a single CGI perl script and many, many modules. The
 application was originally developed with perl 5.6.
 
 I moved it onto an i386 box running perl 5.005 and now there is a
 particular issue that I'm having trouble understanding. What happens
 is that an included module 'require's another module, but it's @INC is
 different than the one defined in the original, single CGI script.
 
 While one quick fix would be to simply add use lib '.' to the
 beginning of this particular module, I would rather diagnose the
 problem as I wonder why it's having this trouble.
 
 The error displayed using CGI.pm's carp is:
 
 Can't locate Time/DaysInMonth.pm in @INC (@INC
 contains:
 /usr/lib/perl5/5.005/i386-linux /usr/lib/perl5/5.005
 /usr/local/lib/site_perl/i386-linux
 /usr/local/lib/site_perl
 /usr/lib/perl5 . /etc/apache/ /etc/apache/lib/perl) at
 ../lib/perl/Time/ParseDate.pm line 896
 
 This does not include the directory included using use libs:
 
 use lib ../lib/perl;
 
 in the one cgi-bin file. The funny thing about this is that the module
 that is throwing the error's location happens to be
 ../lib/perl/Time/ParseDate.pm, which includes:
 
 require Time::DaysInMonth.
 
 Is there an easy solution to this? Am I missing something?

Elizabeth, if I understand you correctly one of the modules adjusts @INC 
but other modules
relying on this don't see the adjusted @INC. Changing the @INC value at 
server startup will
solve this problem. For more info please read:
http://perl.apache.org/guide/porting.html#_INC_and_mod_perl

-- 


_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: Influencing @INC list

2002-02-12 Thread Ged Haywood

Hi there,

On Mon, 11 Feb 2002, Kevin Slean wrote:

 I need to run multiple apache servers on one Solaris 2.7 box configured in
 such a way that each of them accesses their own private copy of perl
 libraries.

Could you accept recompiling Perl without the couple of paths which
get in the way, and then add the missing paths with use lib(...)?

There's lots of stuff about @INC in the Guide.

73,
Ged.




Re: Influencing @INC list

2002-02-11 Thread Stephen Reppucci


OK, I'll be the one to throw out the gratuitous plug for Geoff,
etal's book. The Mod_Perl Cookbook has a nice discussion of exactly
this in Chapter 2. (I'd give you the page, but I left it at work...)

(I'm only through the first few chapters, but from what I've read so
far, this is a real winner.  Buy it.)

Steve

On Mon, 11 Feb 2002, Brian Reichert wrote:

 On Mon, Feb 11, 2002 at 04:29:43PM -0500, Kevin Slean wrote:
 
  Mod Perl Mongers...
 
  I need to run multiple apache servers on one Solaris 2.7 box configured in
  such a way that each of them accesses their own private copy of perl
  libraries.  I would like to achieve this configuration with the
  least amount of changes to my over all implementation.
 
  For instance, given 2 apache servers defined in the following 2 directories:
 
 /usr/local/siteA   - directory tree containing everything for server A
 /usr/local/siteB   - directory tree containing everything for server B
 
  The default perl installation on this unix system is under
  /usr/local/lib/perl5 and the default @INC list is:

 I believe you can abuse PERL5LIB in each vhost...

 
  Kevin
 



-- 
Steve Reppucci   [EMAIL PROTECTED] |
Logical Choice Software  http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=




@INC Not exported in older perl's?

2002-02-07 Thread Elizabeth Barham

Hi,

I have been developing a web application using Apache and mod_perl. It
consists of a single CGI perl script and many, many modules. The
application was originally developed with perl 5.6.

I moved it onto an i386 box running perl 5.005 and now there is a
particular issue that I'm having trouble understanding. What happens
is that an included module 'require's another module, but it's @INC is
different than the one defined in the original, single CGI script.

While one quick fix would be to simply add use lib '.' to the
beginning of this particular module, I would rather diagnose the
problem as I wonder why it's having this trouble.

The error displayed using CGI.pm's carp is:

Can't locate Time/DaysInMonth.pm in @INC (@INC
contains:
/usr/lib/perl5/5.005/i386-linux /usr/lib/perl5/5.005
/usr/local/lib/site_perl/i386-linux
/usr/local/lib/site_perl
/usr/lib/perl5 . /etc/apache/ /etc/apache/lib/perl) at
../lib/perl/Time/ParseDate.pm line 896

This does not include the directory included using use libs:

use lib ../lib/perl;

in the one cgi-bin file. The funny thing about this is that the module
that is throwing the error's location happens to be
../lib/perl/Time/ParseDate.pm, which includes:

require Time::DaysInMonth.

Is there an easy solution to this? Am I missing something?

Thank you, Elizabeth





RE: PerlModule not updating %INC

2001-11-21 Thread Geoffrey Young



 -Original Message-
 From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 20, 2001 6:43 PM
 To: David Pisoni; [EMAIL PROTECTED]; Robert Landrum
 Subject: Re: PerlModule not updating %INC
 
[snip]
 
 It sounds like this is a real bug with PerlModule.  This was 
 supposed to be
 fixed by 1.26, but I guess the fix didn't work or it got broken again.
 (Doug?)

I wonder if this has something to do with the multiple init thing 

http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2

if the interpreter is really being entirely broken down on each restart
(including the initial one that Apache does when it reparses httpd.conf)
%INC might be getting mucked up...

--Geoff



Re: PerlModule not updating %INC

2001-11-21 Thread Perrin Harkins

 I wonder if this has something to do with the multiple init thing

 http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2

It does.  It's exactly the same bug.

 if the interpreter is really being entirely broken down on each restart
 (including the initial one that Apache does when it reparses httpd.conf)
 %INC might be getting mucked up...

It shouldn't.  I thought the interpreter didn't actually get broken down on
restart at all unless you have PerlFreshRestart on.  However, I see that
Doug said this:

i think that using *Apache::ReadConfig elsewhere will still trigger the
double loading of all Perl{Require,Module}s, but i doubt the people
suffering from the double load problem are using that feature.  so i'll
deal with that later.

David, are you using Apache::ReadConfig or anything that uses it?

- Perrin




RE: PerlModule not updating %INC

2001-11-21 Thread Geoffrey Young



 -Original Message-
 From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 21, 2001 11:01 AM
 To: Geoffrey Young; [EMAIL PROTECTED]; David Pisoni
 Subject: Re: PerlModule not updating %INC
 
 
  I wonder if this has something to do with the multiple init thing
 
  http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2
 
 It does.  It's exactly the same bug.
 
  if the interpreter is really being entirely broken down on 
 each restart
  (including the initial one that Apache does when it 
 reparses httpd.conf)
  %INC might be getting mucked up...
 
 It shouldn't.  I thought the interpreter didn't actually get 
 broken down on
 restart at all unless you have PerlFreshRestart on. 
  However, 
 I see that
 Doug said this:
 
 i think that using *Apache::ReadConfig elsewhere will still 
 trigger the
 double loading of all Perl{Require,Module}s, but i doubt the people
 suffering from the double load problem are using that 
 feature.  so i'll
 deal with that later.

yeah, I read that and didn't understand the how patch he offered worked here
at all.

IIRC, I ran a test with only httpd.conf.default with only these additions

PerlModule My::Foo

then

package My::Foo;
warn initializing...;


in lib/perl and I got 'initializing' on each restart.  no Apache::ReadConfig
going on here.

I may have time to test this again today, but if someone else could verify,
that would be great.

--Geoff



Re: PerlModule not updating %INC

2001-11-21 Thread Perrin Harkins

 IIRC, I ran a test with only httpd.conf.default with only these additions

 PerlModule My::Foo

 then

 package My::Foo;
 warn initializing...;


 in lib/perl and I got 'initializing' on each restart.  no
Apache::ReadConfig
 going on here.

And no PerlFreshRestart?




RE: PerlModule not updating %INC

2001-11-21 Thread Geoffrey Young



 -Original Message-
 From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 21, 2001 11:12 AM
 To: Geoffrey Young; [EMAIL PROTECTED]; David Pisoni
 Subject: Re: PerlModule not updating %INC
 
 
  IIRC, I ran a test with only httpd.conf.default with only 
 these additions
 
  PerlModule My::Foo
 
  then
 
  package My::Foo;
  warn initializing...;
 
 
  in lib/perl and I got 'initializing' on each restart.  no
 Apache::ReadConfig
  going on here.
 
 And no PerlFreshRestart?

nope - I literally copied the default httpd.conf and added the single
PerlModule directive.  maybe a ServerName and Port change too, but no other
mod_perl stuff.

this drove me batty as I was trying to document how module initialization
code worked.  I did lots of archive digging and convinced myself that the
current behavior is broken and that Doug thinks that what we all expect to
see is the proper behavior, despite the fact that I created mod_perl builds
back to 1.24 and saw the same thing.

--Geoff 



RE: PerlModule not updating %INC

2001-11-21 Thread Geoffrey Young

ok, here was my test...

[geoff@mainsheet apache]$ diff -u conf/httpd.conf.default conf/httpd.conf
--- conf/httpd.conf.default Wed Nov 21 02:00:16 2001
+++ conf/httpd.conf Wed Nov 21 11:59:35 2001
@@ -38,6 +38,8 @@
 # server as /usr/local/apache/logs/foo.log.
 #
 
+PerlModule My::Foo
+
 ### Section 1: Global Environment
 #
 # The directives in this section affect the overall operation of Apache,
@@ -248,7 +250,7 @@
 #  don't use Group #-1 on these systems!
 #
 User nobody
-Group #-1
+Group nobody
 
 #
 # ServerAdmin: Your address, where problems with the server should be
[geoff@mainsheet apache]$ cat lib/perl/My/Foo.pm 
package My::Foo;
open my $fh, '/tmp/test';
print $fh scalar localtime, \n;
1;
[geoff@mainsheet apache]$ cat /tmp/test
[geoff@mainsheet apache]$ ./bin/apachectl start
./bin/apachectl start: httpd started
[geoff@mainsheet apache]$ cat /tmp/test
Wed Nov 21 12:01:06 2001
[geoff@mainsheet apache]$ ./bin/apachectl restart
./bin/apachectl restart: httpd restarted
[geoff@mainsheet apache]$ cat /tmp/test
Wed Nov 21 12:01:06 2001
Wed Nov 21 12:01:17 2001



that's not what we should be seeing, right?

--Geoff

[geoff@mainsheet apache]$ HEAD http://mainsheet.laserlink.net:8080
200 OK
Connection: close
Date: Wed, 21 Nov 2001 17:04:08 GMT
Accept-Ranges: bytes
Server: Apache/1.3.23-dev (Unix) mod_perl/1.26_01-dev
Content-Length: 413
Content-Type: text/html
ETag: 6b82a-19d-3bdd9d6c
Last-Modified: Mon, 29 Oct 2001 18:18:20 GMT
Client-Date: Wed, 21 Nov 2001 17:04:08 GMT
Client-Peer: 10.5.6.32:8080



Re: PerlModule not updating %INC

2001-11-21 Thread David Pisoni

At 11.00 -0500 11/21/2001, Perrin Harkins wrote:
SNIP

David, are you using Apache::ReadConfig or anything that uses it?

- Perrin

Nope, not using ReadConfig.  And to address another point, the behavior is consistant 
regardless of whether or not PerlFreshRestart is on.

David



Re: PerlModule not updating %INC

2001-11-20 Thread David Pisoni

Hello,

I hate to keep banging this old drum, but since I was able to reproduce this problem 
(but not solve it), I figured I'd recycle it again.  Perrin said earlier that this was 
fixed in 1.26, but I am indeed using 1.26 and the problem persists.  Stas suggested 
upgrading perl to 5.6.1 -- I did so, recompiled mod_perl, and the problem persists.  I 
didn't try upgrading the perl on my darwin box, but the fact that I get the same 
result there is telling.

Can anyone tell me what the fix was from 1.25 to 1.26?  Maybe there's a clue there.

Thanks,
David



I'm still having this problem, and I've discovered that it is also happening on my 
darwin box.  This is enough to lead me to believe the problem is bona fide.

To recap: problem occurs on :
   Darwin (MacOS X) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26
   Red-Hat Linux (7.1) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26
   Red-Hat Linux (7.1) Perl 5.6.1 / Apache 1.3.20 / mod_perl 1.26

Problem : PerlModule does not cause %INC to be updated, but 'use' does

Symptoms : Apache::StatINC does not work for said modules.  Said modules do not 
appear in Apache::Status loaded modules page, but do appear in the Inheritance tree.

Ideas?

Thanks,
David

Date: Thu, 18 Oct 2001 12:57:27 -0800
To: Stas Bekman [EMAIL PROTECTED]
From: David Pisoni [EMAIL PROTECTED]
Subject: Re: PerlModule not updating %INC
Cc: Perrin Harkins [EMAIL PROTECTED], [EMAIL PROTECTED]
Bcc:
X-Attachments:

At 1.13 +0800 10/17/2001, Stas Bekman wrote:
David Pisoni wrote:

At 18.23 -0400 10/11/2001, Perrin Harkins wrote:

At 18.07 -0400 10/11/2001, Perrin Harkins wrote:

We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26.

Are you sure?  There was a problem with %INC and PerlModule, but I

thought

it was fixed in 1.26.

- Perrin

Indeed, like I said, I tested it by dumping %INC myself -- the modules are

indeed missing when loaded with PerlModule.

No, I meant are you sure you're running 1.26?  Please doublecheck it, since
this sounds so much like the bug from the previous release.
- Perrin

Indeed, here's the signature from Apache::Status :

   Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) 
mod_perl/1.26

Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.)

Thanks,
David


So... any ideas on this one?


have you tried 5.6.1? 5.6.0 is very buggy.


Just tried it.  Fresh build of 5.6.1, and mod_perl 1.26 against it.  The problem 
persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded 
with PerlModule directives.

What should I try next. :-)

David

Original Message :

Hello,

We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26.  We are running these 
on a RedHat Linux 7.1, kernel v2.4.2 system.

We have been doing development using mod_perl, but finding that Apache::StatINC was 
not working as expected (i.e., we needed to restart the web server in order to see 
our module changes in effect.)  Our apache config files preload all necessary modules 
at start time using the 'PerlModule' directive.  When I started peeking through 
Apache::Status I found that although all of our loaded modules appear in the 
Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded 
Modules section.  (I also did a test handler with a dump of the contents of %INC, 
and said modules were missing.)  The only modules of ours which DID appear were those 
which were ALSO called for with 'use' calls by other modules.

Out of curiosity, I took our configuration file and changed all the 'PerlModule' 
directives to 'use' calls (inside a Perl block), and lo and behold, they all 
appeared in %INC.

I could not find any documentation suggesting that the PerlModule directive would 
successfully load a module while circumventing %INC, nor do I recall in my previous 
projects developed using mod_perl having this problem.  (Although I've been away 
awhile -- maybe I forget.)

Any guidance?

Thanks,



Re: PerlModule not updating %INC

2001-11-20 Thread Robert Landrum

At 2:31 PM -0800 11/20/01, David Pisoni wrote:
 We have been doing development using mod_perl, but finding that 
Apache::StatINC was not working as expected (i.e., we needed to 
restart the web server in order to see our module changes in 
effect.)  Our apache config files preload all necessary modules at 
start time using the 'PerlModule' directive.  When I started peeking 
through Apache::Status I found that although all of our loaded 
modules appear in the Inheritance Tree and the ISA Tree, most of 
them did not appear in the Loaded Modules section.  (I also did a 
test handler with a dump of the contents of %INC, and said modules 
were missing.)  The only modules of ours which DID appear were those 
which were ALSO called for with 'use' calls by other modules.




I just reread your original post... I think I may know what the 
problem is (maybe).  Are you using Location handlers?

Location /whatever
SetHandler  perl-script
PerlModule My::Special::Module
PerlHandler My::Special::Module
/Location


If that is the case, My::Special::Module won't be loaded and compiled 
until the very first time that someone hits /whatever.

This explains the missing modules in %INC (I think), but it does not 
explain the problem with Apache::StatINC.

 Out of curiosity, I took our configuration file and changed all 
the 'PerlModule' directives to 'use' calls (inside a Perl block), 
and lo and behold, they all appeared in %INC.



And did this fix your problem with Apache::StatINC too?

Rob


--
Only two things are infinite: The universe, and human stupidity. And I'm not
sure about the former. --Albert Einstein



Re: PerlModule not updating %INC

2001-11-20 Thread David Pisoni

At 18.02 -0500 11/20/2001, Robert Landrum wrote:
At 2:31 PM -0800 11/20/01, David Pisoni wrote:
 We have been doing development using mod_perl, but finding that Apache::StatINC 
was not working as expected (i.e., we needed to restart the web server in order to 
see our module changes in effect.)  Our apache config files preload all necessary 
modules at start time using the 'PerlModule' directive.  When I started peeking 
through Apache::Status I found that although all of our loaded modules appear in the 
Inheritance Tree and the ISA Tree, most of them did not appear in the Loaded 
Modules section.  (I also did a test handler with a dump of the contents of %INC, 
and said modules were missing.)  The only modules of ours which DID appear were those 
which were ALSO called for with 'use' calls by other modules.




I just reread your original post... I think I may know what the problem is (maybe).  
Are you using Location handlers?

Location /whatever
SetHandler  perl-script
PerlModule My::Special::Module
PerlHandler My::Special::Module
/Location


If that is the case, My::Special::Module won't be loaded and compiled until the very 
first time that someone hits /whatever.

Just about EVERY module we use has a 'PerlModule' call to it, outside any enclosing 
blocks.  Although I do have 'PerlHandler' directives in Location and Files blocks, 
the modules they use are preloaded prior to the enclosing block.  We're hip to shared 
memory :-)

This explains the missing modules in %INC (I think), but it does not explain the 
problem with Apache::StatINC.

 Out of curiosity, I took our configuration file and changed all the 'PerlModule' 
directives to 'use' calls (inside a Perl block), and lo and behold, they all 
appeared in %INC.



And did this fix your problem with Apache::StatINC too?

Rob


Yes.  StatINC indeed uses %INC to do its magic.  StatINC's success or failure in this 
situation is merely a symptom though, not the real problem.

We could simply set our configuration files as I've described here, but I'm interested 
in mod_perl working correctly for everyone, hence I continue to beat this drum. :-)  I 
don't assume that the problem is unique to us -- rather I assume that we're the only 
ones experiencing it who both realize it and are doing something about it.

Thanks,
David



Re: PerlModule not updating %INC

2001-11-20 Thread Robert Landrum


 If that is the case, My::Special::Module won't be loaded and 
compiled until the very first time that someone hits /whatever.

Just about EVERY module we use has a 'PerlModule' call to it, 
outside any enclosing blocks.  Although I do have 'PerlHandler' 
directives in Location and Files blocks, the modules they use 
are preloaded prior to the enclosing block.  We're hip to shared 
memory :-)

It just hit me That is why Apache::StatINC isn't working.

We use Apache::StatINC on our development server, but we never 
preload any modules...  We just use

Location /whatever
SetHandler  perl-script
PerlHandler My::Special::Module
/Location

and Apache::StatINC works.

If you preload, It's not going to put the module into %INC. 
Otherwise Apache::StatINC would intentionally overwrite that shared 
memory and destroy the purpose for using PerlModule in the first 
place.

I could be wrong...  but I think that the answer is that It's not a 
bug, it's a feature, and that the behavior is actually correct.


Rob

--
Only two things are infinite: The universe, and human stupidity. And I'm not
sure about the former. --Albert Einstein



Re: PerlModule not updating %INC

2001-11-20 Thread David Pisoni

At 18.32 -0500 11/20/2001, Robert Landrum wrote:
 If that is the case, My::Special::Module won't be loaded and compiled until the 
very first time that someone hits /whatever.

Just about EVERY module we use has a 'PerlModule' call to it, outside any enclosing 
blocks.  Although I do have 'PerlHandler' directives in Location and Files 
blocks, the modules they use are preloaded prior to the enclosing block.  We're hip 
to shared memory :-)

It just hit me That is why Apache::StatINC isn't working.

We use Apache::StatINC on our development server, but we never preload any modules... 
 We just use

Location /whatever
SetHandler  perl-script
PerlHandler My::Special::Module
/Location

and Apache::StatINC works.

If you preload, It's not going to put the module into %INC. Otherwise Apache::StatINC 
would intentionally overwrite that shared memory and destroy the purpose for using 
PerlModule in the first place.

If this is true, it is a change from prior behavior.  (And a bit distressing.)  I for 
one would not complain of Apache::StatINC dirtying memory pages -- I'm really only 
concerned with shared memory on a production server, and I wouldn't run StatINC 
outside of the development environment.  Besides, I'm assuming that if I do my trick 
of calling 'use' in a Perl block (which DOES update %INC) that the module code pages 
are still shared.

What is more distressing though is that StatINC may not be the only consumer of %INC.  
(e.g., Apache::Status does not report these modules in Loaded Modules)  The real 
trouble is that it is deviating from Doing the Right Thing by perl.

I could be wrong...  but I think that the answer is that It's not a bug, it's a 
feature, and that the behavior is actually correct.


For the above reasons, I hope you are wrong. :-)  But you may be right!

David



RE: PerlRequire/PerlModule and %INC

2001-11-06 Thread Geoffrey Young

hi guys...

  I know this is from a while ago, but I'm still seeing the double init
thing with PerlModule and PerlRequire on server restarts.  I've tried two
different 5.6.1 installs with current CVS.

  can somebody verify that I'm not seeing things?  the test I was using was
the default httpd.conf.default with just a single PerlModule statement,
trying to boil things down.

thanks

--Geoff

-Original Message-
From: Stas Bekman
To: Perrin Harkins
Cc: mod_perl list
Sent: 8/6/01 11:03 PM
Subject: Re: PerlRequire/PerlModule and %INC

On Mon, 6 Aug 2001, Perrin Harkins wrote:

 There have been some messages on the Mason list about people
experiencing
 startup.pl being loaded twice, even without PerlFreshRestart on.  I
know the
 server restarts during startup, but PerlRequire and PerlModule are
both
 supposed to obey the laws of %INC, right?  I seem to remember some
 discussion about this before, but I can't remember what the outcome
was and
 I can't find it in the archive.

The discussion is here:
http://forum.swarthmore.edu/epigone/modperl/lelswyskix

The patch is here:
http://forum.swarthmore.edu/epigone/modperl/lelswyskix/Pine.LNX.4.21.010
[EMAIL PROTECTED]

it's already fixed in 1.26. I've tested again just in case, it works
properly now.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: PerlModule not updating %INC

2001-10-30 Thread David Pisoni

I'm still having this problem, and I've discovered that it is also happening on my 
darwin box.  This is enough to lead me to believe the problem is bona fide.

To recap: problem occurs on :
Darwin (MacOS X) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26
Red-Hat Linux (7.1) Perl 5.6.0 / Apache 1.3.20 / mod_perl 1.26
Red-Hat Linux (7.1) Perl 5.6.1 / Apache 1.3.20 / mod_perl 1.26

Problem : PerlModule does not cause %INC to be updated, but 'use' does

Symptoms : Apache::StatINC does not work for said modules.  Said modules do not appear 
in Apache::Status loaded modules page, but do appear in the Inheritance tree.

Ideas?

Thanks,
David

Date: Thu, 18 Oct 2001 12:57:27 -0800
To: Stas Bekman [EMAIL PROTECTED]
From: David Pisoni [EMAIL PROTECTED]
Subject: Re: PerlModule not updating %INC
Cc: Perrin Harkins [EMAIL PROTECTED], [EMAIL PROTECTED]
Bcc:
X-Attachments:

At 1.13 +0800 10/17/2001, Stas Bekman wrote:
David Pisoni wrote:

At 18.23 -0400 10/11/2001, Perrin Harkins wrote:

At 18.07 -0400 10/11/2001, Perrin Harkins wrote:

We are using perl 5.6.0 for Apache 1.3/20, with mod_perl 1.26.

Are you sure?  There was a problem with %INC and PerlModule, but I

thought

it was fixed in 1.26.

- Perrin

Indeed, like I said, I tested it by dumping %INC myself -- the modules are

indeed missing when loaded with PerlModule.

No, I meant are you sure you're running 1.26?  Please doublecheck it, since
this sounds so much like the bug from the previous release.
- Perrin

Indeed, here's the signature from Apache::Status :

Embedded Perl version v5.6.0 for Apache/1.3.20 (Unix) (Red-Hat/Linux) 
mod_perl/1.26

Apache.pm shows v1.27 (that's a little weird, but I assume unimportant.)

Thanks,
David


So... any ideas on this one?


have you tried 5.6.1? 5.6.0 is very buggy.


Just tried it.  Fresh build of 5.6.1, and mod_perl 1.26 against it.  The problem 
persists -- %INC is incomplete vs. my actual loaded modules, missing what was loaded 
with PerlModule directives.

What should I try next. :-)

David




  1   2   >