How to execute .pl script?

 
Post new topic   Reply to topic    34SP.com Forum Index // Scripting Support
View previous topic :: View next topic  
Author Message
goldgin
34SP Newbie
34SP Newbie


Joined: 03 Jan 2012
Posts: 1

PostPosted: Tue Jan 03, 2012 12:28 am    Post subject: How to execute .pl script? Reply with quote
Probably a very simple question.
I've uploaded a simple Hello World perl script as /cgi-bin/hello.pl (not as /httpdocs/cgi-bin/hello.pl)
also set permissions to 777

How do I execute it from a web browser? I've tried www.mydomain.com/cgi-bin/hello.pl and got 500 Error

My goal is to unzip a file on the server (I'm on a reseller so I can't ssh) and CPanel doesn't support this.
Back to top
View user's profile Send private message
philr
Super Member
Super Member


Joined: 05 Nov 2003
Posts: 990
Location: Exeter

PostPosted: Tue Jan 03, 2012 10:10 am    Post subject: Reply with quote
I suspect that scripts with permissions of 0777 may be blocked from running. Try 0755 instead.

And check your error log. People often forget to send out HTTP headers from their Perl scripts. This will cause a "Premature end of script headers" error message. The bare minimum requirement is a Content-Type header. Try putting this at the top of your script:
Code:

   print "Content-Type: text/plain\r\n\r\n";


_________________
Phil Ronan
フィリップ・ローナン
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    34SP.com Forum Index // Scripting Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2002 phpBB Group