+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: I know.. Python Help again, but its not working..

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

    I know.. Python Help again, but its not working..

    Ok, I have never ran python on a server, but i thought i would give it a try, but with no luck.


    its driveing me crazzy, i got the permissions right... cmod 755 DUH!


    got the .htaccess right? i think, its what they said before would work..

    AddHandler cgi-script .cgi .py .pl .pm


    PERL is working fine as ALWAYS, but not this darn Python...
    Code:
     
    #!/usr/bin/python
    #!/usr/bin/env python
     
    print "Content-Type: text/html \r\n\r\n" 
    print "Hello, World!"

    Code:
    Internal Server Error
     
    The server encountered an internal error or misconfiguration and was unable to complete your request.
     
    Please contact the server administrator, webmaster@setapartcomputersolutions.pcriot.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
     
    More information about this error may be available in the server error log.
     
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    any help in the right direction would be great! THNX

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

    Re: I know.. Python Help again, but its not working..

    Only the first shebang will have any affect, and it needs to be on the first line. Remember, "#!" is actually a magic number. Any shebangs not on the first line are just comments.

    Also note that you typically don't need to print CRLF. LF will be translated to CRLF.
    Last edited by misson; 08-31-2009 at 05:47 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

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

    Re: I know.. Python Help again, but its not working..

    well...

    i have been all over this darn forum, and it is still not working, also, the code i have there is from here: http://forums.x10hosting.com/program...g-scratch.html

    I have tried evry shebang i can find, but with no luck.


    I edited the .htaccess evry way someone said, i did 755, tried 50 scripts nothing is working yet... gerrrr!


    I know this is going to be some stupid simple thing, it always is.
    thanks for your help...

  4. #4
    gillwill is offline x10Hosting Member gillwill is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    9

    Re: I know.. Python Help again, but its not working..

    Have you tried running it from cgi-bin folder first to see if it works from there?

    Can you cut & paste your htaccess contents here. Maybe some typo in there.
    Last edited by gillwill; 08-31-2009 at 11:20 PM.

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

    Re: I know.. Python Help again, but its not working..

    No, it will not run anywhere!

    I can run a PERL script anywhere as a CGI

    but Python will not work,

    On my PERL i have
    #!/usr/bin/perl -w "Works fine"

    and python
    #!/usr/bin/python "Error"

    whats wrong here?
    thnx


    also, i take the same cgi file, cmod it, write as a PERL script, run it, it dose fine. but then I past in the Python, and it gets an error.
    Last edited by nate_bro; 08-31-2009 at 11:20 PM.

  6. #6
    gillwill is offline x10Hosting Member gillwill is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    9

    Re: I know.. Python Help again, but its not working..

    [quote=nate_bro;572341]
    Code:
     
    #!/usr/bin/python
    #!/usr/bin/env python
     
    print "Content-Type: text/html \r\n\r\n" 
    print "Hello, World!"

    Wow, that is bizarre, as when I copy & pasted your code it works for me whether in cgi-bin folder or elsewhere.

    Hopefully, someone more experienced than I in here will come up with something.

    -gil

  7. #7
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: I know.. Python Help again, but its not working..

    works just fine for me...
    see, here's the proof: http://kbjrweb.com/cgi-bin/test.py

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

    Re: I know.. Python Help again, but its not working..

    Did you remove the blank line at the start of the script? Is "Options +ExecCGI" included in .htaccess?
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  9. #9
    nate_bro is offline x10Hosting Member nate_bro is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    6

    Re: I know.. Python Help again, but its not working..

    If i write a script say, myscript.cgi and write it in PERL and it works, then just replace the PERL code with the Phython it should work right??

    this is my .htaccess
    the server is processing it, so the .htaccess should not be the prob right? otherwise it would just display in plain text...
    Code:
    # -FrontPage-
      <Limit GET POST>
      order deny,allow
      deny from all
      allow from all
      </Limit>
      <Limit PUT DELETE>
      order deny,allow
      deny from all
      </Limit>
      AuthName setapartcomputersolutions.pcriot.com
      AuthUserFile /home/natebro/public_html/_vti_pvt/service.pwd
      AuthGroupFile /home/natebro/public_html/_vti_pvt/service.grp
      AddHandler cgi-script .cgi .py .pl .pm

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

    Re: I know.. Python Help again, but its not working..

    That should be sufficient. Chances are there's something wrong with the script, such as a unicode byte-order mark (BOM). Please post a zipped copy of the script as an attachment.
    Last edited by misson; 09-01-2009 at 02:54 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Domain stopped working
    By devongovett in forum Free Hosting
    Replies: 1
    Last Post: 05-05-2008, 08:04 PM
  2. Subdomain not working
    By trogenhorse in forum Free Hosting
    Replies: 5
    Last Post: 04-28-2008, 10:57 AM
  3. ads are not working
    By rayminator in forum Free Hosting
    Replies: 5
    Last Post: 03-23-2008, 09:07 PM
  4. Python Current Status
    By caCollege in forum Free Hosting
    Replies: 5
    Last Post: 03-20-2008, 10:23 AM
  5. Site not working
    By Immortal in forum Free Hosting
    Replies: 1
    Last Post: 09-10-2005, 02:49 PM

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