+ Reply to Thread
Results 1 to 6 of 6

Thread: python/perl help

  1. #1
    kdmqforforum is offline x10Hosting Member kdmqforforum is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    6

    python/perl help

    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:

  2. #2
    Noobmaster is offline x10Hosting Member Noobmaster is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    1

    Re: python/perl help

    What errors do you get?

    Also do you have the shebang line?

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

  3. #3
    kdmqforforum is offline x10Hosting Member kdmqforforum is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    6

    Red face Re: python/perl help

    Quote Originally Posted by Noobmaster View Post
    What errors do you get?

    Also do you have the shebang line?

    #!/usr/bin/perl
    #!/usr/bin/python
    #!/usr/bin/env python
    yes, i have the shebang line, however i have never tried
    #!/usr/bin/env python

    i get a simple 500 error

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: python/perl help

    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).

  5. #5
    kdmqforforum is offline x10Hosting Member kdmqforforum is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    6

    Re: python/perl help

    Quote Originally Posted by misson View Post
    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

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: python/perl help

    Quote Originally Posted by kdmqforforum View Post
    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.

    Quote Originally Posted by kdmqforforum View Post
    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.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers