Re: Issuing rollback() for database handle being DESTROY'd
> I recently noticed some strange error messages in my error_log. This is > from animelyrics.com, which uses Apache::ASP and MySQL. > > Issuing rollback() for database handle being DESTROY'd without explicit > disconnect() at (eval 9) line 22. > > The above line keeps repeating over and over in the error log. There are > two things that confuse me... > > (1) I never use rollback() anywhere in my code... so I'm wondering if > something else could cause a rollback. > I get the same problem if I don't explicitly disconnect from the database. You can ignore this problem if you're just making SELECT queries. Also if the MySQL version you're using doesn't use transactions then it autocommits data by default. DBI is also autocommit by default. If you're annoyed by the error. put a 'dbh->disconnect' at the end of your scripts. > (2) The "(eval 9) line 22" message doesn't tell me what file the error is > in. The modperl guide suggested adding the following lines to my perl > startup file so that the messages would show the correct file: > > use Carp (); > local $SIG{__WARN__} = \&Carp::cluck; > > ...but they don't seem to have any effect after I added them and did an > "apachectl restart". > > -Philip Mak ([EMAIL PROTECTED]) > > . > Mak ([EMAIL PROTECTED]) > > . > -- Mike
Re: [OT] Problems preparing a module for CPAN
[EMAIL PROTECTED] (Martin Langhoff) wrote: >% h2xs -AX -n Mail::Vmailmgr >% cd Mail/ >% vi Vmailmgr.pm > >and wrote all of my module there, picking what h2xs had prepared. >Now when I follow the next step, it fails: > >% make dist >make: *** No rule to make target `dist'. Stop. You need to create the makefile (by doing perl Makefile.PL) before you can start issuing 'make' commands. The 'dist' target in the makefile is created automatically by your Makefile.PL. O, what I wouldn't give for the standard module builder to be based on Perl and not 'make'. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: $r->dir_info and BEGIN {}?
How about: package ModPerlPackage; use vars qw( $is_init ); $is_init = 0; sub handler($) { ... $is_init = initialize($r) unless $is_init; ... } Just making initialize return a true value on success. There's undoubtedly a much more subtle solution... HTH Jim Rafael Kitover wrote: > > We obviously do not have access to a request object during a BEGIN {} > block, but if I have a bunch of PerlSetVar things that I don't want to > re-initialize every time handler() is called for speed reasons, what is > the most elegant way to have an initialization sub that needs access to > things set in PerlSetVar? Just something like: > > my $is_initialized = 0; > > sub handler($) { > ... > unless ($is_initialized) { > initialize($r); > $is_initialized = 1; > } > ... > } > > sub initialize($) { > ... > do stuff with $r->dir_info("thingie") > ... > } > > The problem with this is that initialize would be called for every > child, though this is better than initializing stuff at every request. > > TIA > > -- > Do what thou wilt shall be the whole of the Law. > Love is the law, love under will. > > >Part 1.2Type: application/pgp-signature
Re: [OT] Problems preparing a module for CPAN
> hi, > > once again, steering off-topic ... :( > > I've got a nice little module (Mail::Vmailmgr) I am trying to bundle > in the standard CPAN fashion, so that it has a proper Makefile.PL, > etc. > > I am following my Perl Cookbook, recipe 12.8 ... steps taken: > > % h2xs -AX -n Mail::Vmailmgr > % cd Mail/ > % vi Vmailmgr.pm > > and wrote all of my module there, picking what h2xs had prepared. > Now when I follow the next step, it fails: > > % make dist > make: *** No rule to make target `dist'. Stop. > > And neither `man perlmod`, `man perlmodlib`, CPAN or O'Reilly's > errata page has any hint ... > > Now many fellow hackers here seem to be releasing successfully to > CPAN... so ... what's the secret? What am I missing? (a neuron or > two, maybe?) > > > martin > Try man perlxs man xsubpp man ExtUtils::MakeMaker for some more documentation. Quick Start your Makefile.PL should look something like this for one of my perl only modules. It is only slightly different for modules that contain C generated stuff. use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'BZS::Access', 'VERSION_FROM' => 'Access.pm', # finds $VERSION 'PREREQ_PM' => {'BZS::CryptHash'=> '2.04'}, 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} ); Michael [EMAIL PROTECTED]
Re: Where can I find....
> "Michael" <[EMAIL PROTECTED]> wrote: > >Where can I find documentation on the how to use all the values that > >appear in Apache::Constants > > > >The obviously do something, but what??? > >I figured out what OK, DECLINED do by reading the source, but what > >about all the rest. Are they described somewhere?? > > Andrew Ford's reference card lists them (not sure of the URL). As > far as I can tell, they are fairly straightforward if you keep in > mind that they are copies of constants used in Apache and HTTP. For > example, HTTP_* constants are typically status codes in the > protocol. M_* constants are HTTP methods. > > I don't know of anyplace that treats the constants specifically. > They are usually incidental to doing something. Thanks, I have the complete list. It is given in man Apache::Constants What I'm trying to do is figure out how to use them. The two above OK, and DECLINED can be returned to an internal call from the auth portion of Apache and will allow it to proceed or bomb. I'd like to find out what the rest do. From their names many of them appear like they could be quite useful. Michael [EMAIL PROTECTED]
Re: Where can I find....
"Michael" <[EMAIL PROTECTED]> wrote: >Where can I find documentation on the how to use all the values that >appear in Apache::Constants > >The obviously do something, but what??? >I figured out what OK, DECLINED do by reading the source, but what >about all the rest. Are they described somewhere?? Andrew Ford's reference card lists them (not sure of the URL). As far as I can tell, they are fairly straightforward if you keep in mind that they are copies of constants used in Apache and HTTP. For example, HTTP_* constants are typically status codes in the protocol. M_* constants are HTTP methods. I don't know of anyplace that treats the constants specifically. They are usually incidental to doing something. +- James Smith - [EMAIL PROTECTED] | http://www.jamesmith.com/ [EMAIL PROTECTED] | http://sourcegarden.org/ [EMAIL PROTECTED] | http://cis.tamu.edu/systems/opensystems/ +--
[OT] Problems preparing a module for CPAN
hi, once again, steering off-topic ... :( I've got a nice little module (Mail::Vmailmgr) I am trying to bundle in the standard CPAN fashion, so that it has a proper Makefile.PL, etc. I am following my Perl Cookbook, recipe 12.8 ... steps taken: % h2xs -AX -n Mail::Vmailmgr % cd Mail/ % vi Vmailmgr.pm and wrote all of my module there, picking what h2xs had prepared. Now when I follow the next step, it fails: % make dist make: *** No rule to make target `dist'. Stop. And neither `man perlmod`, `man perlmodlib`, CPAN or O'Reilly's errata page has any hint ... Now many fellow hackers here seem to be releasing successfully to CPAN... so ... what's the secret? What am I missing? (a neuron or two, maybe?) martin
Where can I find....
Where can I find documentation on the how to use all the values that appear in Apache::Constants The obviously do something, but what??? I figured out what OK, DECLINED do by reading the source, but what about all the rest. Are they described somewhere?? [EMAIL PROTECTED]
Re: problems with make test, server not starting <- RESOLVED
> [root@localhost mod_perl-1.24_01]# ps axf | grep httpd > 2888 ?S 0:01 ../apache_1.3.14/src/httpd -f >/root/mod_perl-1.24_01/t/conf/httpd.conf -X -d /root/mod_perl-1.24_01/t > 10510 ?S 0:00 /usr/local/apache/bin/httpd > 10511 ?SW 0:00 \_ [httpd] > 10512 ?SW 0:00 \_ [httpd] > 10513 ?SW 0:00 \_ [httpd] > 10514 ?SW 0:00 \_ [httpd] > 10515 ?S 0:00 \_ [httpd] > 10516 ?SW 0:00 \_ [httpd] Ok, i killed those guys, typed make test, and guess what happened? httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done /usr/bin/perl t/TEST 0 modules/actions.ok modules/cgi.ok modules/constants...ok modules/cookie..skipping test on this platform modules/fileok modules/httpdconf...ok modules/include.ok modules/log.ok modules/module..skipping test on this platform modules/perlrun.ok modules/psections...skipping test on this platform modules/request.skipping test on this platform modules/src.ok modules/ssi.ok modules/stage...skipping test on this platform modules/status..ok modules/symbol..skipping test on this platform modules/uri.ok modules/utilok internal/apiok internal/auth...ok internal/croak..ok internal/dirmagic...ok internal/error..ok internal/headersok internal/hooks..ok internal/http-get...ok internal/http-post..ok internal/proxy..ok internal/redirect...ok internal/rwrite.ok internal/stackedok internal/table..ok internal/taint..ok All tests successful, 6 tests skipped. Files=34, Tests=377, 16 wallclock secs (10.01 cusr + 1.16 csys = 11.17 CPU) kill `cat t/logs/httpd.pid` rm -f t/logs/httpd.pid rm -f t/logs/error_log YEA BABY YEA! Thanks a million Ged. :) Richard.
Re: problems with make test, server not starting
Hi again, On Thu, 28 Dec 2000, Richard wrote: > > My idea is to find out if you already have an Apache hanging onto > > port 8259 - in which case you need to stop it! > > [root@localhost mod_perl-1.24_01]# ps axf | grep httpd > 2888 ?S 0:01 ../apache_1.3.14/src/httpd -f >/root/mod_perl-1.24_01/t/conf/httpd.conf -X -d /root/mod_perl-1.24_01/t > 10510 ?S 0:00 /usr/local/apache/bin/httpd > 10511 ?SW 0:00 \_ [httpd] > 10512 ?SW 0:00 \_ [httpd] > 10513 ?SW 0:00 \_ [httpd] > 10514 ?SW 0:00 \_ [httpd] > 10515 ?S 0:00 \_ [httpd] > 10516 ?SW 0:00 \_ [httpd] This is your currently running Apache. By the look of things it's listening on port 8259. Stop it! 73, Ged.
Re: problems with make test, server not starting
On Thu, 28 Dec 2000, G.W. Haywood wrote: > Hi there, > > On Thu, 28 Dec 2000, Richard wrote: > > > "Waiting for server to warm up.. server failed to start!" > [snip] > > [Thu Dec 28 21:33:14 2000] [crit] (98)Address already in use: make_sock: could not >bind to port 8529 > > What happens if you say: > > 'ps axf | grep httpd' > > ? > > My idea is to find out if you already have an Apache hanging onto > port 8259 - in which case you need to stop it! > > 73, > Ged. [root@localhost mod_perl-1.24_01]# ps axf | grep httpd 2888 ?S 0:01 ../apache_1.3.14/src/httpd -f /root/mod_perl-1.24_01/t/conf/httpd.conf -X -d /root/mod_perl-1.24_01/t 10510 ?S 0:00 /usr/local/apache/bin/httpd 10511 ?SW 0:00 \_ [httpd] 10512 ?SW 0:00 \_ [httpd] 10513 ?SW 0:00 \_ [httpd] 10514 ?SW 0:00 \_ [httpd] 10515 ?S 0:00 \_ [httpd] 10516 ?SW 0:00 \_ [httpd]
Re: problems with make test, server not starting
On Thu, Dec 28, 2000 at 09:58:41PM +, Richard wrote: > On Thu, 28 Dec 2000, you wrote: > > Screw the tests. Mine fails all the time, I just type 'make install' and it > > all works perfectly. > > Hmn, just tried that. > > my httpd.conf file did not seem to change, i setup a directive for > Apache::Status to see if it was all ok, but get a config error telling me it > does not understand PerlHandler. Would that suggest that i am trying to start a > non mod_perl enabled apache? > > :-( > > i don't want to grab an RPM. > > Richard
Re: problems with make test, server not starting
try: make kill_httpd && sleep 5 && make test Richard wrote: > > > the error log > ~ > [Thu Dec 28 21:33:14 2000] [crit] (98)Address already in use: make_sock: could not >bind to port 8529 > ~ -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Re: problems with make test, server not starting
Hi again, On Thu, 28 Dec 2000, Richard wrote: > my httpd.conf file did not seem to change, It won't. > get a config error telling me it does not understand PerlHandler. > Would that suggest that i am trying to start a non mod_perl enabled > apache? Yup. But it only SUGGESTS it. Your error_log will TELL you. > i don't want to grab an RPM. Good idea. :) 73, Ged.
Re: problems with make test, server not starting
On Thu, 28 Dec 2000, you wrote: > Screw the tests. Mine fails all the time, I just type 'make install' and it > all works perfectly. Hmn, just tried that. my httpd.conf file did not seem to change, i setup a directive for Apache::Status to see if it was all ok, but get a config error telling me it does not understand PerlHandler. Would that suggest that i am trying to start a non mod_perl enabled apache? :-( i don't want to grab an RPM. Richard
problems with make test, server not starting
Deal All. This is really starting to pick away at my patience. I simple cannot get mod_perl installed. Installed Apache 1.3.14 easy peasy. I am making mod_perl with EVERYTHING=1 and APACHE_PREFIX=/some/location/to/apache Even without any of the options, for makefile.pl, i am getting the same damn error. "Waiting for server to warm up.. server failed to start!" Another guy had the same problem in January this year, and i have followed Stas Berkman's advice for him, my /etc/hosts file is as it should be, and no idea if loopback is configured correctly. This is off a fresh install of Mandrake 7.0, i'm a complete linux newbie, perhaps there is a switch i have not thrown that will let it all work ok? argh! Any pointers would be s very much greatly appreciated. Richard - %make test ~ ../apache_1.3.14/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t & httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done /usr/bin/perl t/TEST 0 still waiting for server to warm up...not ok server failed to start! (please examine t/logs/error_log) at t/TEST line 95. make: *** [run_tests] Error 9 ~ the error log ~ [Thu Dec 28 21:33:14 2000] [crit] (98)Address already in use: make_sock: could not bind to port 8529 ~
[ANNOUNCE] Avacet Application Engine 2.0b2
Hi! I've been quiet for a while on this list, but I still read it religiously. I wanted to take a second and share our announcement of the release of the second beta of the Avacet Application Engine. Version 2.0b2 of the Avacet Application Engine is available for download at http://www.avacet.com. The Avacet software suite consists of two main parts. The first is a language-neutral definition of data and interfaces for exchanging data, and the second is a reference implementation of an application engine that implements the Avacet framework and client libraries. It is suitable for the development of custom enterprise applications that require a high degree of scalability, reliability, and interoperability. The second beta release of the Avacet Application Engine adds a language-independent definition format for module interfaces, offers XML/RPC over HTTP, new HOWTO documentation geared toward new users, and many other enhancements. This is the last beta before version 2.0 of the Avacet Application Engine Perhaps more so than other application platforms, the Avacet engine is targeted toward building enterprise quality applications in a Perl and Apache/mod_perl environment. The Avacet framework itself is a language-neutral and open standard for describing data and protocols for data exchange. Because the definition is not represented in a particular programming language, we are able to implement client libraries in multiple languages (such as Perl) that can share common middle-tier business logic. I fundamentally believe that Perl, when written well, can be an enterprise ready programming language, and that Apache/mod_perl is one of the best environments (if not the best) for building web applications. To that end, we have built a feature rich set of modules that ease the development of mod_perl applications. The Avacet Perl libraries offer a ModPerlApplication base class, as well as a Service object model for dynamic templates (using HTML::Embperl), XML based configuration, memory and file system based object caching, an "exception" model for Perl, among many other features. I'm announcing this on the mod_perl list because I hope that our code offers value to engineers doing mod_perl development. We are using the Avacet engine and the Perl modules for our own e-commerce application suite. By taking advantage of the Avacet framework, business logic can be shared between custom mod_perl apps, those we develop at Avacet, and those developed at large by the community. We have mailing lists set up at the Avacet site, and I invite people to join us at the avacet-developers list. I'd be happy to set up an avacet-perl list if the mod_perl community finds these libraries to be useful. You are all invited to check out the second avacet beta at http://www.avacet.com. I look forward to hearing your feedback! Best regards, -DeWitt
$r->dir_info and BEGIN {}?
We obviously do not have access to a request object during a BEGIN {} block, but if I have a bunch of PerlSetVar things that I don't want to re-initialize every time handler() is called for speed reasons, what is the most elegant way to have an initialization sub that needs access to things set in PerlSetVar? Just something like: my $is_initialized = 0; sub handler($) { ... unless ($is_initialized) { initialize($r); $is_initialized = 1; } ... } sub initialize($) { ... do stuff with $r->dir_info("thingie") ... } The problem with this is that initialize would be called for every child, though this is better than initializing stuff at every request. TIA -- Do what thou wilt shall be the whole of the Law. Love is the law, love under will. PGP signature
Re: Book/code recommendations needed for an urgent mod_perrl task
Peter Demling wrote: > > Greetings from a 1st-time poster, > > I'm a seasoned web programmer, but a Perl beginner and > mod_perl stranger who has an "as soon as possible" > mod_perl script to write for our Apache web server, so > I'd appreciate any recommendations for books or code > you may have, which could assist me in my task. What > I have to do is as follows: > > Write a mod_perl script which will: 1] be invoked > (with parameters) by a web client; 2] use its input > parameters to construct an SQL statement; 3] query an > Oracle database on a seperate machine with the > constructed SQL statement; 4] use the returned query > results to set the values of some variables; 5] use > these variables to construct HTML output, and send it > back to the web client. > > I'm a quick-read, so as a Perl beginner who wants to > keep the script as simple as possible, I'm assuming > that "Learning Perl" is the best text for me, but does > anyone think that "Programming Perl" OR "The Perl > Cookbook" might be a better choice? I'm also thinking > that "Writing Apache Modules with Perl and C" will be > neccessary, but perhaps the online mod_perl guide > would be sufficient? IMHO Learning Perl is a little basic for someone with a bit of programming experience - if you have little experience then read it. Apache Modules in Perl & C has is some excellent book - and has some good examples. I find the Cookbook excellent for the answer to the "How do I do XXX ?" questions. Read the Guide - period ! > > Last, I'm assuming that the basic structure of this > databse-driven web script is fairly common, so any > pointers to relevant code I could base this on would > be greatly appreciated. >From the above you will have lots of examples to choose from. Greg Cope > > Sincerely, > -Peter Demling > Amherst, MA > [EMAIL PROTECTED] > > __ > Do You Yahoo!? > Yahoo! Photos - Share your holiday photos online! > http://photos.yahoo.com/
Re: Book/code recommendations needed for an urgent mod_perrl task
reading ALL those books is highly recommended. u might be able to handle the task at hand faily quickly with: DBIx::Recordset (i've never used it - but it looks easy) and HTML::Embperl (i use it extensively and i'm very happy with it) both are available at www.cpan.org good luck! -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/ Peter Demling wrote: > Greetings from a 1st-time poster, > > I'm a seasoned web programmer, but a Perl beginner and > mod_perl stranger who has an "as soon as possible" > mod_perl script to write for our Apache web server, so > I'd appreciate any recommendations for books or code > you may have, which could assist me in my task. What > I have to do is as follows: > > Write a mod_perl script which will: 1] be invoked > (with parameters) by a web client; 2] use its input > parameters to construct an SQL statement; 3] query an > Oracle database on a seperate machine with the > constructed SQL statement; 4] use the returned query > results to set the values of some variables; 5] use > these variables to construct HTML output, and send it > back to the web client. > > I'm a quick-read, so as a Perl beginner who wants to > keep the script as simple as possible, I'm assuming > that "Learning Perl" is the best text for me, but does > anyone think that "Programming Perl" OR "The Perl > Cookbook" might be a better choice? I'm also thinking > that "Writing Apache Modules with Perl and C" will be > neccessary, but perhaps the online mod_perl guide > would be sufficient? >
RFC: Apache::FileMan pre-release 0.03
I have been getting more good feedback on the Apache::FileMan module. FileMan provides a file manager for a web sites through a web browser. It is a extensive rewrite of the Apache::AutoIndex.pm module (written by Philippe M. Chiasson), which in turn was a remake of the autoindex Apache module. FileMan can provide the same functionality as AutoIndex.pm and can be used to both navigate and manage the web site. The current pre-release version is 0.03 and is available for download from: httpd://www.xorgate.com/ A demo is available by accessing: httpd://www.xorgate.com/FileMan/demo/.XFM user name=fileman password=13dec00 In version 0.02, I added a destination text field, which helps make the commands more intuitive. I also added a "View" command that allows you to view files (MiME) within FileMan. In version 0.03, I added a select check box and hid the "Select Item" text field, which again helps the user interface. The "View" command was removed, because the file links now DECLINE the request (just like AutoIndex.pm) so that Apache can presents the file. The command list includes: "Browse", "Upload", "Unzip", "Move", "Copy", "Rename", "Delete", "Mkdir", "Help", and "SetGID". I still plan to add an EDIT command. Also, I need provide a remote way to allow the admin user to revoke other user's privileges, outside of the authorization module's data and httpd.conf. All comments welcomed.
Book/code recommendations needed for an urgent mod_perrl task
Greetings from a 1st-time poster, I'm a seasoned web programmer, but a Perl beginner and mod_perl stranger who has an "as soon as possible" mod_perl script to write for our Apache web server, so I'd appreciate any recommendations for books or code you may have, which could assist me in my task. What I have to do is as follows: Write a mod_perl script which will: 1] be invoked (with parameters) by a web client; 2] use its input parameters to construct an SQL statement; 3] query an Oracle database on a seperate machine with the constructed SQL statement; 4] use the returned query results to set the values of some variables; 5] use these variables to construct HTML output, and send it back to the web client. I'm a quick-read, so as a Perl beginner who wants to keep the script as simple as possible, I'm assuming that "Learning Perl" is the best text for me, but does anyone think that "Programming Perl" OR "The Perl Cookbook" might be a better choice? I'm also thinking that "Writing Apache Modules with Perl and C" will be neccessary, but perhaps the online mod_perl guide would be sufficient? Last, I'm assuming that the basic structure of this databse-driven web script is fairly common, so any pointers to relevant code I could base this on would be greatly appreciated. Sincerely, -Peter Demling Amherst, MA [EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/
Re: File Upload problems
I tried it with and without binmode with the same results, thats why I figured I was using binmode wrong. "G.W. Haywood" wrote: > Hi there, > > On Thu, 28 Dec 2000, cbell wrote: > > > It is Mod perl 1.24_01, perl 5.005_03, and Apache 1.3.14 running on > > Redhat 6.2. > > Hmmm. Do you need to use binmode() at all? If you didn't, > then you probably wouldn't get any binmode problems... > > perldoc -f binmode > > 73, > Ged.
Re: File Upload problems
Hi there, On Thu, 28 Dec 2000, cbell wrote: > It is Mod perl 1.24_01, perl 5.005_03, and Apache 1.3.14 running on > Redhat 6.2. Hmmm. Do you need to use binmode() at all? If you didn't, then you probably wouldn't get any binmode problems... perldoc -f binmode 73, Ged.
Re: File Upload problems
It is Mod perl 1.24_01, perl 5.005_03, and Apache 1.3.14 running on Redhat 6.2. "G.W. Haywood" wrote: > Hi there, > > On Thu, 28 Dec 2000, cbell wrote: > > > I'm pretty sure this is a binmode problem, > > Did I miss the bit where you told us which operating system, Perl > version, and all that good stuff? If you search around in the > mod_perl directory you should find a file called SUPPORT. > > :) > > 73, > Ged.
Re: CGI generated image/png problem?
In case anyone was wondering, found another thread in reference to it and the "solution": http://www.egroups.com/message/modperl/26850 http://www.ee.ethz.ch/~slist/rrd-users/msg01700.html http://www.ee.ethz.ch/~slist/rrd-users/msg01704.html The problem is with older versions of libgd... Adi On Thu, Dec 28, 2000 at 01:40:49AM -0800, R.P. Aditya wrote: > I have a simple script dynamically generating a PNG based on form input: > > > #!/usr/bin/perl > # genImage.perl > use strict; > > print < Content-type: image/png > > LLI > > genPNG(); #a subroutine that can produce PNGs using libpng > > > this worked fine before I used mod_perl. I've tried using: > > $q->header('image/png'); > > instead of the print "Content-Type" line, to no avail. Annoyingly enough, if > I generate a jpeg ($q->header('image/jpeg')), albeit with a different library > routine, it works fine... > > Other possibly relevant details: > > Apache/1.3.12 (Unix) mod_perl/1.23 > > and in httpd.conf: > > >SetHandler perl-script >PerlHandler Apache::Registry >PerlSendHeader On >Options +ExecCGI > > > I've even tried with PerlSendHeader Off and adding "HTTP 1/1 200 OK" headers > with the same result -- jpegs work fine, PNG does not... > > Clues? I suspect it's a problem with the PNG production and some intereaction > between mod_perl and the headers that stock Apache doesn't encounter, but will > be most interested if there might be another explanation or solution. > > Thanks, > Adi >
Re: File Upload problems
Hi there, On Thu, 28 Dec 2000, cbell wrote: > I'm pretty sure this is a binmode problem, Did I miss the bit where you told us which operating system, Perl version, and all that good stuff? If you search around in the mod_perl directory you should find a file called SUPPORT. :) 73, Ged.
RE: Dynamic content that is static
You might want to take a look at Strudel. It is a project people from my last job were working on: http://www.research.att.com/~mff/strudel/. Regards, Christian > -Original Message- > From: Philip Mak [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 22, 2000 8:09 PM > To: [EMAIL PROTECTED] > Subject: Dynamic content that is static > > > Hi everyone, > > I have been going over the modperl tuning guide and the > suggestions that > people on this list sent me earlier. I've reduced MaxClients > to 33 (each > httpd process takes up 3-4% of my memory, so that's how much I can fit > without swapping) so if the web server overloads again, at > least it won't > take the machine down with it. > > Running a non-modperl apache that proxies to a modperl apache > doesn't seem > like it would help much because the vast majority of pages > served require > modperl. > > I realized something, though: Although the pages on my site are > dynamically generated, they are really static. Their content doesn't > change unless I change the files on the website. (For example, > http://www.animewallpapers.com/wallpapers/ccs.htm depends on > header.asp, > footer.asp, series.dat and index.inc. If none of those files > change, the > content of ccs.htm remains the same.) > > So, it would probably be more efficient if I had a /src > directory and a > /html directory. The /src directory could contain my modperl > files and a > Makefile that knows the dependencies; when I type "make", it > will evaluate > the modperl files and parse them into plain HTML files in the /html > directory. > > Does anyone have any suggestions on how to implement this? Is there an > existing tool for doing this? How can I evaluate > modperl/Apache::ASP files > from the command line? > > Thanks, > > -Philip Mak ([EMAIL PROTECTED]) > > > >
Re: Undefined subroutine
it's telling you to search the guide at: http://perl.apache.org/guide/ check out in particular: http://thingy.kcilink.com/modperlguide/troubleshooting/Undefined_subroutine_Apache_RO.html Barry Veinotte wrote: > > > Undefined subroutine &Apache::ROOT::cgi_2dbin::ads1::ads_2epl::handler > called at /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Registry.pm line 135. > -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
RE: Undefined subroutine
I may have found the answer http://perl.apache.org/dist/cgi_to_mod_perl.html the perl version is 5.003 and from what I have read in the guide 5.003 and mod_perl don't make life easy for cgi scripts. Would my problems be taken care of if Perl were upgraded to 5.004 ? Is there any hope of getting things running properly with 5.003? Barry > -Original Message- > From: Barry Veinotte [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 28, 2000 2:44 PM > To: [EMAIL PROTECTED] > Subject: Undefined subroutine > > > Hi folks, > > I am trying to get a program to run under mod_perl using Apache::Registry > and am getting the following error: > > Undefined subroutine &Apache::ROOT::cgi_2dbin::ads1::ads_2epl::handler > called at /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Registry.pm line 135. > > I am working with Red Hat Linux 6.2 > > I am totally new to this, and have no idea what this error is telling me. > If someone could point me in the right direction I would greatly appreciate it. > > Thanks, > Barry > > >
Undefined subroutine
Hi folks, I am trying to get a program to run under mod_perl using Apache::Registry and am getting the following error: Undefined subroutine &Apache::ROOT::cgi_2dbin::ads1::ads_2epl::handler called at /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Registry.pm line 135. I am working with Red Hat Linux 6.2 I am totally new to this, and have no idea what this error is telling me. If someone could point me in the right direction I would greatly appreciate it. Thanks, Barry
File Upload problems
Hello everyone, I was hoping someone could give me a hand with file uploads in mod perl. Everytime I try to upload a file, the browser will stall a couple of times, and the file ends up on the server as a zero byte file. I'm pretty sure this is a binmode problem, and I've tried it a bunch of different ways, but nothing seems to work. I've included the code for my upload form and my upload procedure. If anyone can shed any light on this problem I'd really appreciate it!!! Thanks alot # Display upload form $query = new CGI; print $query->start_multipart_form; print $query->filefield('uploaded_file','file',50,256); print $query->submit('SubmitUpload','Upload'); print $query->endform; # Upload Procedure my $buffer; my $inputfile = param('uploaded_file'); open (OUTFILE,">$ENV{DOCUMENT_ROOT}/images/test.gif") ; binmode OUTFILE; binmode $inputfile; while (read($inputfile,$buffer,1024)) { print OUTFILE $buffer; } ## end while
Re: Cannot start httpd - help
>>> "G.W. Haywood" wrote: > Hi there, > > On Thu, 28 Dec 2000, Donnie Cherng wrote: > > > I have tried to install > >apache_1.3.14 and mod_perl-1.24_01. > > > > No problem on the "configure, make, make install". However, when I tried to > > start httpd by "/home/users/dcherng/apache/bin/apachectl start", I got > > > > Syntax error on line 207 of /home/users/dcherng/apache/conf/httpd.conf: > > Cannot load /home/users/dcherng/apache/libexec/mod_vhost_alias.so into s erver: ld.so.1: /home/users/dcherng/apache/bin/httpd: fatal: relocation er ror: file /home/users/dcherng/apache/libexec/mod_vhost_alias.so: symbol ap _pcalloc: referenced symbol not > found > > /home/users/dcherng/apache/bin/apachectl start: httpd could not be start ed > > Do you actually need mod_vhost_alias? > > If not, comment out the line(s) in httpd.conf that refer to it and try > again. I'd prefer to build static anyway. It's all in the Guide, I would like to use "mod_perl" modules. I don't think the "static" way can do it. Just comment out the mod_vhost_alias line. But the the second LoadModule "mod_env.so" has the same problem. Thanks, Donnie > > http://perl.apache.org/guide > > HTH. If you need more, shuot again. > > 73, > Ged.
Re: Cannot start httpd - help
Hi there, On Thu, 28 Dec 2000, Donnie Cherng wrote: > I have tried to install > apache_1.3.14 and mod_perl-1.24_01. > > No problem on the "configure, make, make install". However, when I tried to > start httpd by "/home/users/dcherng/apache/bin/apachectl start", I got > > Syntax error on line 207 of /home/users/dcherng/apache/conf/httpd.conf: > Cannot load /home/users/dcherng/apache/libexec/mod_vhost_alias.so into server: >ld.so.1: /home/users/dcherng/apache/bin/httpd: fatal: relocation error: file >/home/users/dcherng/apache/libexec/mod_vhost_alias.so: symbol ap_pcalloc: referenced >symbol not found > /home/users/dcherng/apache/bin/apachectl start: httpd could not be started Do you actually need mod_vhost_alias? If not, comment out the line(s) in httpd.conf that refer to it and try again. I'd prefer to build static anyway. It's all in the Guide, http://perl.apache.org/guide HTH. If you need more, shuot again. 73, Ged.
Cannot start httpd - help
I have tried to install apache_1.3.14 and mod_perl-1.24_01. No problem on the "configure, make, make install". However, when I tried to start httpd by "/home/users/dcherng/apache/bin/apachectl start", I got Syntax error on line 207 of /home/users/dcherng/apache/conf/httpd.conf: Cannot load /home/users/dcherng/apache/libexec/mod_vhost_alias.so into server: ld.so.1: /home/users/dcherng/apache/bin/httpd: fatal: relocation error: file /home/users/dcherng/apache/libexec/mod_vhost_alias.so: symbol ap_pcalloc: referenced symbol not found /home/users/dcherng/apache/bin/apachectl start: httpd could not be started The file /home/users/dcherng/apache/libexec/mod_vhost_alias.so is there. The system is Solaris 7. Compiled mod_perl-1.24_01 first perl Makefile.PL APACHE_SRC=../apache_1.3.14 DO_HTTPD=1 USE_APACI=1 PREFIX=/home/users/dcherng/pm INSTALLSITELIB=/home/users/dcherng/pm INSTALLSITEARCH=/home/users/dcherng/pm make make install and then, apache_1.3.14 was compiled with ./configure --prefix=/home/users/dcherng/apache --enable-module=most --enable-shared=max make make install Can someone point me the problem? thanks, Donnie
Re: mod_perl v1.16 Win32
On Thu, 28 Dec 2000, Christian Ribeaud wrote: > Hi, > > I am not used to bother people for such a simple question but I can not get the >mod_perl v1.16 working. I am using the ActiveState Perl interpreter v5.6.0 and the >path to the interpreter is e:\perl (Windows NT 4.0 SP 6a) > I properly installed the module in Apache 1.3.14 and I think the problem rests with >the lib. I tried to install the whole mod_perl distribution's lib directory in the >e:\perl\lib and/or in the e:\perl\site\lib. I still get the apache error: cannot load >the module... > What is wrong? I would be very grateful if you could help me. I wish you a happy >new-year and have a nice day. Best regards, > > christian > predict ag > Try the mod_perl cvs version, available at http://perl.apache.org/from-cvs/modperl/ in order to compile with ActivePerl. Alternatively, there's mod_perl ppm packages available through http://theoryx5.uwinnipeg.ca/ppmpackages/ If you use these, make sure you get the version that corresponds to your apache version, and that when you start apache, the ActivePerl Perl binary is in your PATH. best regards, randy kobes
Apache::Request and redirects
I'm not on the list so please CC me on any replies. It seems that using Apache::Request and $r->internal_redirect is not a good idea. The code fragment: 119 my $mstatus = $mh->handle_request($r); 120 if ($mstatus != HTTP_OK) { 121 my $filename = $r->filename; 122 $filename =~ s,^(.*)/.*$,$1/error.html,; 123 print STDERR "Redirecting to $filename\n"; 124 my $rstatus = $r->internal_redirect_handler($filename); 125 print STDERR "Internal redirect done\n"; 126 return $rstatus; The request object creates itself as undefined data the second time around, and the web server does not succeed in the redirect. Even though I have passed my Anarres::Request (inheriting Apache::Request) to the internal_redirect method, Apache creates a new Apache object and uses that in the subrequest. I want the parameters from the first request to be preserved into the subrequest. Another minor issue is that Apache::Request is not trivially subclassed, the returned value from $self->SUPER::new() must be reblessed into the desired class. S. -- Shevek I am the Borg. sub AUTOLOAD { ($s=$AUTOLOAD)=~s/.*:://; eval qq{ *$AUTOLOAD=$s ?sub {$s*&{$s-1}} :sub {1}; }; goto &$AUTOLOAD; } print &{'4'};
mod_perl v1.16 Win32
Hi, I am not used to bother people for such a simple question but I can not get the mod_perl v1.16 working. I am using the ActiveState Perl interpreter v5.6.0 and the path to the interpreter is e:\perl (Windows NT 4.0 SP 6a) I properly installed the module in Apache 1.3.14 and I think the problem rests with the lib. I tried to install the whole mod_perl distribution's lib directory in the e:\perl\lib and/or in the e:\perl\site\lib. I still get the apache error: cannot load the module... What is wrong? I would be very grateful if you could help me. I wish you a happy new-year and have a nice day. Best regards, christian predict ag
CGI generated image/png problem?
I have a simple script dynamically generating a PNG based on form input: #!/usr/bin/perl # genImage.perl use strict; printheader('image/jpeg')), albeit with a different library routine, it works fine... Other possibly relevant details: Apache/1.3.12 (Unix) mod_perl/1.23 and in httpd.conf: SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On Options +ExecCGI I've even tried with PerlSendHeader Off and adding "HTTP 1/1 200 OK" headers with the same result -- jpegs work fine, PNG does not... Clues? I suspect it's a problem with the PNG production and some intereaction between mod_perl and the headers that stock Apache doesn't encounter, but will be most interested if there might be another explanation or solution. Thanks, Adi
Re: Issuing rollback() for database handle being DESTROY'd
Philip Mak wrote: > > I recently noticed some strange error messages in my error_log. This is > from animelyrics.com, which uses Apache::ASP and MySQL. > > Issuing rollback() for database handle being DESTROY'd without explicit > disconnect() at (eval 9) line 22. > This implies that you have a database handle that is destroyed in the scope of running your program. Then it would seem that you are not using Apache::DBI? I don't think I get this error when I start using Apache::DBI. Remember to load Apache::DBI before DBI. ]# perl -MDBI -e 'DBI->connect(qw(dbi:mysql:host=...), qw(root))'; Issuing rollback() for database handle being DESTROY'd without explicit disconnect(). Apache::DBI keeps a connection cached so that it won't close until your apache child exits. It probably then issues a disconnect itself. > > (1) I never use rollback() anywhere in my code... so I'm wondering if > something else could cause a rollback. > Note with above, its probably just DBI that does it. > (2) The "(eval 9) line 22" message doesn't tell me what file the error is > in. The modperl guide suggested adding the following lines to my perl > startup file so that the messages would show the correct file: > > use Carp (); > local $SIG{__WARN__} = \&Carp::cluck; > > ...but they don't seem to have any effect after I added them and did an > "apachectl restart". > Does: use Carp (); $SIG{__WARN__} = \&Carp::cluck; that work better after a stop/start? -- Josh
Re: RFC/ANNOUNCE: WebsiteGenerator, FormGenerator, Class-ParamParser
The modules look very cool. However You should be careful as to what modules you've created solve a problem in a particular way that you enjoy using and which ones are truly generic. Some of the following was unclear in your email explanation of the modules. I am worried that some of your CGI::* modules have taken a hold of a generic namespace when they should belong either somewhere else in CPAN or under CGI::WPM. eg Why is CGI::SequentialFile under CGI::? Shouldn't a data storage module you are relying on be under a totally different tree? And also what are you using CGI::SequentialFile for? It's a bit unclear as to the relationship there. Of course, I should be one to talk... I've never uploaded anything to CPAN yet (although I've got an ID now... ). Congrats on taking that step forward. :) At 10:41 PM 12/27/2000 -0800, Darren Duncan wrote: >I have uploaded new versions of my 3 distributions to CPAN: > > - Class-ParamParser-1.0.tar.gz - 1 module > - CGI-FormGenerator-0.9201.tar.gz- 7 modules > - CGI-WebsiteGenerator-0.3201.tar.gz - 9 modules > >My authorname is DUNCAND. > >Name DSLI Description > > >Class::ParamParser - bdpO - complex parameter parsing for subclass methods > >HTML::TagMaker - bdpO - make single,groups of HTML tags, head/footers >HTML::FormMaker - adpO - predefined persistant forms, reports, validate >HTML::PageMaker - bdpO - store,assemble web page parts, search+replace >CGI::HashOfArrays- bdpO - data storage,parsing,url-encoding, subset >CGI::WebUserIO - cdpO - gather,parse,manage user input data, env vars >CGI::SequentialFile - bdpO - HoA/hash data storage in encoded k=v text file >CGI::EventCountFile - bdpO - store date-bounded event counts in file (usage) > >CGI::WPM::Globals- cdpO - store prefs, fs/path contexts, user i/o, utils >CGI::WPM::Base - cdpO - defines API for subclassed WPM modules >CGI::WPM::MultiPage - adpO - WPM resolves nav in page hierarchy, makes menu >CGI::WPM::Static - bdpO - WPM for displaying static html,text pages >CGI::WPM::MailForm - adpO - WPM impl e-mail submis forms w/ unlimit quest >CGI::WPM::GuestBook - adpO - WPM impl gb w/ unlimit quest, e-ml to sign/ownr >CGI::WPM::SegTextDoc - bdpO - WPM displays static single/multipart text pages >CGI::WPM::Redirect - bdpO - WPM for issuing an HTTP redirection header >CGI::WPM::Usage - bdpO - WPM tracks usage details, e-mails bkup to owner
Issuing rollback() for database handle being DESTROY'd
I recently noticed some strange error messages in my error_log. This is from animelyrics.com, which uses Apache::ASP and MySQL. Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at (eval 9) line 22. The above line keeps repeating over and over in the error log. There are two things that confuse me... (1) I never use rollback() anywhere in my code... so I'm wondering if something else could cause a rollback. (2) The "(eval 9) line 22" message doesn't tell me what file the error is in. The modperl guide suggested adding the following lines to my perl startup file so that the messages would show the correct file: use Carp (); local $SIG{__WARN__} = \&Carp::cluck; ...but they don't seem to have any effect after I added them and did an "apachectl restart". -Philip Mak ([EMAIL PROTECTED])