Results 1 to 7 of 7
Thread: CGI / Perl not working ?
-
08-27-2006, 07:15 PM #1Newbie
- Join Date
- Aug 2005
- Posts
- 11
CGI / Perl not working ?
Hey guys, iv had my server for a little while now, and im still a n00b lol, but its mainly only used for my own site.
I came to learning CGI the other day as I already know a little PHP, and when trying to run my first basic script i got errors. Iv reearched it and a site says that its not a very descriptive error so anything could be wrong, the error I keep getting is a 500 internal server error.
The script I was trying to run is basic:
PHP Code:#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "Hello, world!\n";
Code:root@server [~]# which perl /usr/local/bin/perl
PHP Code:#!/usr/local/bin/perl -wT
print "Content-type: text/html\n\n";
print "Hello, world!\n";
thanks for your time.
-
08-27-2006, 10:11 PM #2Web Hosting Master
- Join Date
- Apr 2001
- Location
- Paradise
- Posts
- 12,052
Do you chmod your files to 755? what's the folder permission?
Do you know if your host does require to have your Perl/CGI files on any special folder such as cgi-bin/ or anything similar?█ Shared Web Hosting - Reseller Hosting - Semi-Dedicated Servers - SolusVM/XEN VPS
█ LiteSpeed Powered - R1Soft Continuous Data Protection - 24/7 Chat/Email/Helpdesk Support
█ Cpanel/WHM - Softaculous - R1soft Backup - Litespeed - Cloudlinux -Site Builder- SSH support - Account Migration
█ DowntownHost LLC - In Business since 2001- West/Center/East USA - Netherlands - Singapore
-
08-28-2006, 03:17 AM #3Web Hosting Evangelist
- Join Date
- Oct 2004
- Location
- India
- Posts
- 509
As Mentioned by Jedito, you need to place the file in correct cgi directory with proper permission and ownership.
ESC :wq!
-
08-28-2006, 06:49 AM #4Junior Guru Wannabe
- Join Date
- Nov 2004
- Location
- Northamptonshire
- Posts
- 56
Another thing to check:
If you are uploading via. FTP make sure ASCII mode is on. The perl interpreter doesn't like /r/n codes.Andrew Hutchings (A-Wing) - Linux Jedi
A-Wing Internet Services
Windows is the path to the darkside...Windows leads to Blue Screen. Blue Screen leads to downtime. Downtime leads to suffering...I sense much Windows in you.
-
08-28-2006, 07:54 AM #5Web Hosting Evangelist
- Join Date
- Oct 2004
- Location
- India
- Posts
- 509
Originally Posted by A-WingESC :wq!
-
08-28-2006, 08:22 AM #6Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
And the error log might give you more details.
Ssh to the server and tail the apache error log while you take the page in the browser. It might give you a clearer picture.
-
08-28-2006, 08:31 AM #7Newbie
- Join Date
- Aug 2005
- Posts
- 11
Originally Posted by A-Wing
thanks, something so stupid causes all these problems.
thanks very much.