python/perl help

kdmqforforum

New Member
Messages
6
Reaction score
0
Points
0
i got a new account in plan #1
kdmq.pcriot.com

python/perl won't work

all files in cgi-bin
all file headers #!/usr/bin/python or perl
all chmod set to 0777

PHP works as long at the files are out of cgi-bin

so what do i need to change. :happysad:
 

Noobmaster

New Member
Messages
1
Reaction score
0
Points
0
What errors do you get?

Also do you have the shebang line?

#!/usr/bin/perl
#!/usr/bin/python
#!/usr/bin/env python
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Check the output of your CGI scripts on your development server and your error logs. You must output properly formatted headers before other output else you'll get a 500 error. Any script errors will be printed to stderr, which is unbuffered and will be output before anything your script prints to stdout. Thus script errors cause a 500 server error. Even if your scripts work locally, they could be producing an error on the server (often due to a missing/not found library).
 

kdmqforforum

New Member
Messages
6
Reaction score
0
Points
0
Check the output of your CGI scripts on your development server and your error logs. You must output properly formatted headers before other output else you'll get a 500 error. Any script errors will be printed to stderr, which is unbuffered and will be output before anything your script prints to stdout. Thus script errors cause a 500 server error. Even if your scripts work locally, they could be producing an error on the server (often due to a missing/not found library).

i don't understand what you men by 'development server'
what is the output of the CGI script

i have a test.pl file that says this:

#!/usr/bin/perl

print "content-type: text/html\n\n";
print "hello";

basicly this is not working
so please post another reply plz
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
i don't understand what you men by 'development server'

The computer you use to develop. It could be as simple as the computer with a test editor or it could run a web server configured for debugging of live scripts.

what is the output of the CGI script

Go to the command line and run your script. If you're running MS Windows, you'll first need to install Perl (e.g. ActivePerl) and Python to run the scripts.

The script you posted shouldn't produce errors. There's probably a problem with the server configuration. As long as both the scripts and cgi-bin directory have mode 755 (777 means everyone has write access, which is a big security risk), it isn't a permissions problem. Check the "Apache Handlers" section of cPanel; you should see a "cgi-script" handler for file extensions .cgi and .pl (among others). Also check your error log in cPanel. If nothing is there, post your root .htaccess; there might be something misconfigured in there.
 
Top