Making .pm files run.
I got a website from a friend and I was trying to get it to work on server running FREEBSD with Apache and modperl. The website was coded to run an Alias called go and has several .pm files. I got the alias go by adding a line of configuration to the httpd.conf file but I've had no luck with .pm files. I even tried the complete patch to the file which is something like /go/1.pm and nothing, like if I was pointing nowhere. Do I need to add something else to the httpd.conf file in order to execute those .pm files? I'm completely new to modperl and apache, any help will be greatly appreciated. -- View this message in context: http://www.nabble.com/Making-.pm-files-run.-tf3016257.html#a8376413 Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Making .pm files run.
This is the information i gathered based on your request: >From httpd-error.log: [Mon Jan 15 15:50:36 2007] [notice] Apache/1.3.34 (Unix) mod_perl/1.29 configure d -- resuming normal operations Here is one of the files Recipes.pm package Recipes; use strict; use Apache::Constants; use RecipePrintTool; use RecipeTool; use MyRecipeTool; use RecipeReviews; use RecipeEmailTool; use RecipeSearchTool; sub handler { my $r = shift; my @uri = split /\//, $r->uri(); my $prg; if ($uri[3] eq "print_recipe") { $prg = RecipePrintTool->new($r); } elsif ($uri[3] eq "my_recipe") { $prg = MyRecipeTool->new($r); } elsif ($uri[3] eq "recipe_reviews") { $prg = RecipeReviews->new($r); } elsif ($uri[3] eq "email_recipe") { $prg = RecipeEmailTool->new($r); } elsif ($uri[3] eq "recipe_search") { $prg = RecipeSearchTool->new($r); } else { $prg = RecipeTool->new($r); } $prg->Main(); $r->push_handlers( PerlHandler => 'Handlers::Finish_Page' ); return OK; } 1; __END__ - Should I run it as a Registry or as a Handler? These are the only changes that I've made to the httpd.conf file. I changed the DocumentRoot to : DocumentRoot "/usr/home/httpd/domains/www.ehunter.com/ehunter_html" then I added go as an Alias. Recipes.pm is inside the folder Handlers. I'm trying to execute Recipes.pm by going to http://localhost/go/Recipes but nothing. Alias /go/ /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers/ PerlModule go::Recipes SetHandler perl-script PerlHandler go::Recipes Options +ExecCGI PerlSendHeader On allow from all -- View this message in context: http://www.nabble.com/Making-.pm-files-run.-tf3016257.html#a8380720 Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Making .pm files run.
I added these lines: use lib '/usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers'; PerlModule Recipes SetHandler perl-script PerlHandler Recipes Options +ExecCGI PerlSendHeader On allow from all Now im getting this error on the httpd-error.log file: Syntax error on line 691 of /usr/local/etc/apache/httpd.conf: Can't locate Image/Magick.pm in @INC (@INC contains: /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local/lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 . /usr/local/ /usr/local/lib/perl) at /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers/RecipeTool.pm line 6. BEGIN failed--compilation aborted at /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers/RecipeTool.pm line 6. Compilation failed in require at /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers/Recipes.pm line 6. BEGIN failed--compilation aborted at /usr/home/httpd/domains/www.ehunter.com/ehunter_perl/Handlers/Recipes.pm line 6. Compilation failed in require at (eval 9) line 3. -- View this message in context: http://www.nabble.com/Making-.pm-files-run.-tf3016257.html#a8394174 Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Making .pm files run.
I installed Image Magick, but now im getting this error: http# apachectl restart /usr/local/sbin/apachectl restart: httpd not running, trying to start Syntax error on line 691 of /usr/local/etc/apache/httpd.conf: Can't locate Mail/Sendmail.pm in @INC (@INC contains: /usr/home/httpd/domains/ww w.ehunter.com/ehunter_perl/Handlers /usr/local/lib/perl5/5.8.8/BSDPAN /usr/local /lib/perl5/site_perl/5.8.8/mach /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/ lib/perl5/site_perl /usr/local/lib/perl5/5.8.8/mach /usr/local/lib/perl5/5.8.8 . /usr/local/ /usr/local/lib/perl) at /usr/home/httpd/domains/www.ehunter.com/ehu nter_perl/Handlers/RecipeEmailTool.pm line 6. BEGIN failed--compilation aborted at /usr/home/httpd/domains/www.ehunter.com/ehu nter_perl/Handlers/RecipeEmailTool.pm line 6. Compilation failed in require at /usr/home/httpd/domains/www.ehunter.com/ehunter _perl/Handlers/Recipes.pm line 9. BEGIN failed--compilation aborted at /usr/home/httpd/domains/www.ehunter.com/ehu nter_perl/Handlers/Recipes.pm line 9. Compilation failed in require at (eval 9) line 3. I'm sorry if im bothering you guys, I just want to make this work. Thanks in advance. Sean Davis-3 wrote: > > On Tuesday 16 January 2007 12:03, iNetForce wrote: > >> Now im getting this error on the httpd-error.log file: >> >> Syntax error on line 691 of /usr/local/etc/apache/httpd.conf: >> Can't locate Image/Magick.pm in @INC > > Looks like your code depends on Image::Magick. You will probably need to > install it. It is available on CPAN. > > Sean > > -- View this message in context: http://www.nabble.com/Making-.pm-files-run.-tf3016257.html#a8396625 Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Making .pm files run.
You got me lost there, the terminology you guys use really throw me off, sorry :( sendmail is installed on the system, what exactly do I need to do so I dont get the sendmail error? Michael Peters wrote: > > > > iNetForce wrote: >> I installed Image Magick, but now im getting this error: >> >> http# apachectl restart >> /usr/local/sbin/apachectl restart: httpd not running, trying to start >> Syntax error on line 691 of /usr/local/etc/apache/httpd.conf: >> Can't locate Mail/Sendmail.pm in @INC (@INC contains: > > Now it's looking for Mail::Sendmail which will need to be installed as > well. > It's quite possible that there are many more of these which need to be > installed. So you can just keep installing them. To translate the file > path name > into a Perl module name you basically change all '/' into '::' and then > drop the > final '.pm'. > > -- > Michael Peters > Developer > Plus Three, LP > > > -- View this message in context: http://www.nabble.com/Making-.pm-files-run.-tf3016257.html#a8397895 Sent from the mod_perl - General mailing list archive at Nabble.com.