You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by w trillich <wi...@pinncomp.net> on 2000/04/21 23:29:59 UTC

do "file" -- does NOTHING

if you can find the problem, LET ME KNOW. i'm on the verge
of a breakdown.

at the end of my http.conf i've got:

	PerlRequire "startup.pl"

the entire listing for startup.pl is:

	package Apache::ReadConfig;

	Apache->httpd_conf("Clavis");
	Apache->httpd_conf("</Frammistat>");
	Apache->httpd_conf("<Chibblewink> 1/2%3'*");
	Apache->httpd_conf("isn't this wonderful?");

so i try
	# apachectl configtest
	[Fri Apr 21 16:19:25 2000] [error] Can't locate object method
"httpd_conf" via package "Apache" at startup.pl line 7.

	Syntax error on line 280 of /etc/apache/httpd.conf:
	Can't locate object method "httpd_conf" via package "Apache" at
startup.pl line 7.

i change the bottom of my http.conf to:

	<perl>
	do "startup.pl";
	</perl>

and then i do

	# apachectl graceful
	/usr/sbin/apachectl graceful: httpd gracefully restarted

there are no complaints, no log messages, no problems reported.

the perl code runs. apache reloads its settings, as if
the perl code were empty.

the execution of the code does NOTHING; it's IGNORED completely.

anybody got any ideas?

Re: do "file" -- does NOTHING

Posted by Matt Carothers <ma...@telepath.com>.

On Fri, 21 Apr 2000, w trillich wrote:

> the entire listing for startup.pl is:
> 
> 	package Apache::ReadConfig;
> 
> 	Apache->httpd_conf("Clavis");
> 	Apache->httpd_conf("</Frammistat>");
> 	Apache->httpd_conf("<Chibblewink> 1/2%3'*");
> 	Apache->httpd_conf("isn't this wonderful?");

You need to use() the Apache module in order to access its methods.  Add 
this to the top of your startup.pl:

BEGIN
{ 
	use Apache();
}

- Matt



Re: do "file" -- does NOTHING

Posted by Doug MacEachern <do...@covalent.net>.
this is either something 5.6.0 broke, or nobody has been using
Apache->httpd_conf, patch below fixes.
the MMN check isn't needed anymore anyhow, we've given up supporting older
versions of Apache long ago.

Index: Apache/Apache.pm
===================================================================
RCS file: /home/cvs/modperl/Apache/Apache.pm,v
retrieving revision 1.46
diff -u -r1.46 Apache.pm
--- Apache/Apache.pm	2000/04/05 04:55:55	1.46
+++ Apache/Apache.pm	2000/04/26 01:06:28
@@ -24,16 +24,14 @@
     __PACKAGE__->mod_perl::boot($VERSION);
 }
 
-if($ENV{MOD_PERL} && perl_hook("Sections")) {
+BEGIN {
     *Apache::ReadConfig:: = \%ApacheReadConfig::;
+}
 
-    if(Apache::Constants::MODULE_MAGIC_NUMBER() >= 19971026) {
-	*Apache::httpd_conf = sub {
-	    shift;
-	    push @Apache::ReadConfig::PerlConfig,
-	    map "$_\n", @_;
-	};
-    }
+sub httpd_conf {
+    shift;
+    push @Apache::ReadConfig::PerlConfig,
+      map "$_\n", @_;
 }
 
 sub parse_args {