Welcome to Dream.In.Code
Getting Help is Easy!

Join 105,763 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,688 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Installing a Script

 
Reply to this topicStart new topic

Installing a Script, In Perl

brandon99337
post 7 May, 2008 - 12:20 PM
Post #1


D.I.C Head

**
Joined: 14 Feb, 2008
Posts: 86


My Contributions


I have no idea about anything with perl but this script seemed very interesting.

Hosted on 1 free site it looks like this...

Working Host

But on the others it looks like this (view attachment errorpage)

It's the exact same code (view attachment auctionweaver1)

What's wrong?


Attached File(s)
Attached File  errorpage.htm ( 98.07k ) Number of downloads: 32
Attached File  auctionweaver1.txt ( 103.83k ) Number of downloads: 28
User is offlineProfile CardPM

Go to the top of the page


girasquid
post 7 May, 2008 - 12:48 PM
Post #2


Barbarbar

Group Icon
Joined: 3 Oct, 2006
Posts: 1,141



Thanked 6 times

Dream Kudos: 625
My Contributions


I can't seem to see an error message - just an .htm file.
User is online!Profile CardPM

Go to the top of the page

Petebardo
post 7 May, 2008 - 12:58 PM
Post #3


New D.I.C Head

*
Joined: 14 Dec, 2006
Posts: 12


My Contributions


From the appearance of the two attached files, Perl is not installed (or not installed correctly) on those two servers. The one with the htm extension is probably a Windows server. It's hard to tell about the other.

The two servers are returning the Perl script itself instead of processing the script.
User is offlineProfile CardPM

Go to the top of the page

girasquid
post 7 May, 2008 - 01:18 PM
Post #4


Barbarbar

Group Icon
Joined: 3 Oct, 2006
Posts: 1,141



Thanked 6 times

Dream Kudos: 625
My Contributions


Ooooh - so errorpage.htm is the actual output of your page.

Is it a windows server? Does it have Perl installed, and is the .cgi or .pl(whichever the script has) set up properly to run via the Perl compiler?

The second case is not having the proper handler within the Apache configuration(if it's an Apache system), which is why it's sending the script as plaintext. You need to add this line to .htaccess:
CODE

AddHandler cgi-script .cgi
User is online!Profile CardPM

Go to the top of the page

brandon99337
post 7 May, 2008 - 01:45 PM
Post #5


D.I.C Head

**
Joined: 14 Feb, 2008
Posts: 86


My Contributions


Well do you know any free hosting that provides it already installed?
User is offlineProfile CardPM

Go to the top of the page

girasquid
post 7 May, 2008 - 04:45 PM
Post #6


Barbarbar

Group Icon
Joined: 3 Oct, 2006
Posts: 1,141



Thanked 6 times

Dream Kudos: 625
My Contributions


I generally don't use free hosting, as I host all my projects myself.

You might want to try contacting the hosting company, and asking if Perl is installed or not - if it's not, try seeing if they'll install it for you - sometimes all you need to do is ask.
User is online!Profile CardPM

Go to the top of the page

mocker
post 7 May, 2008 - 08:20 PM
Post #7


D.I.C Head

**
Joined: 14 Oct, 2007
Posts: 160



Thanked 4 times
My Contributions


Have you tried simply renaming your page to end with .pl or .cgi ? Almost all free hosts have perl installed, but it won't know to use perl for your page unless you use those extensions, or edit your .htaccess

The line girasquid wrote:
CODE

AddHandler cgi-script .cgi

associates files ending with .cgi . If you want all your .htm files to be parsed as cgi (the most common way for perl to work) then it would be
CODE

AddHandler cgi-script .htm

This is hardly ever done though since all htm files will need to be programs or they won't process correctly.

If you are on a linux host, those lines just go in your .htaccess file in your main directory
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 01:54PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month