Lunarpages Web Hosting Forum

Author Topic: Perl Program Locations?  (Read 2285 times)

Offline 9x23w

  • Trekkie
  • **
  • Posts: 14
Perl Program Locations?
« on: July 10, 2005, 11:08:59 AM »
My perl pgls (xxx.pl or xxx.cgi) run fine from the /cgi-bin sub directory but not from any other.

Is there a way to have them run from any directory?

Thanks.

Priest

  • Guest
Re: Perl Program Locations?
« Reply #1 on: July 11, 2005, 12:04:05 AM »
Try adding the following code to the .htaccess file in your public_html folder:

Code: [Select]
Options +ExecCGI

Offline 9x23w

  • Trekkie
  • **
  • Posts: 14
Re: Perl Program Locations?
« Reply #2 on: July 11, 2005, 05:40:42 AM »
Thanks, tried that, also added

Addhandler cgi-script cgi pl

But in both cases I still get 'Internal Server Error'

http://roihost.net/cgi-bin/p1.pl    *** works ***

http://roihost.net/p1.pl   *** doesn't work ***

Is there something LP has to change to allow Perl programs in any directory?

Thanks

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
Re: Perl Program Locations?
« Reply #3 on: July 11, 2005, 07:25:10 AM »
It works now ;)
You had it at chmod 644
Apache likes 755 fpr perl scripts it's funny that way.

Offline 9x23w

  • Trekkie
  • **
  • Posts: 14
Re: Perl Program Locations?
« Reply #4 on: July 19, 2005, 07:25:14 AM »
Thank you Stephanie, but I am still having trouble.

I uploaded p2.pl, the same program that just prints a different message.  I 'chmod' it using file manager to 755, but it still doesn't work like the original p1.pl.

Neither does p1.cgi, which is also set to 755.  p1.pl works.  Is there something magical in what you did?

Thanks.

Offline StephanieŽ

  • Master Jedi
  • *****
  • Posts: 1090
Re: Perl Program Locations?
« Reply #5 on: July 19, 2005, 07:45:12 AM »
Hi,

If you want perl to print a simple HTML page try this example below:
Code: [Select]
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";

print "<TITLE>Test File</TITLE>";
print "</HEAD>";
print "<BODY bgcolor=#E8E8E8>
<font face=Verdana size=2><center>testing
<br>Hello From Perl</center></font>";
print "</BODY></HTML>";

Have Phun! :)