Jump to content

Recommended Posts

Posted

I have kept a file in cgi-bin with permission set to 755

but it gives an error. Check out the link to find the error

http://urjas.heliohost.org/cgi-bin/Hi.py

 

The contents of the file are as follows

---------------------------------------------------

#!/usr/bin/python

print "Content-Type: text/html \n"

 

print("<html>")

print("<body>")

 

print( "Hi there")

 

print("</body>")

print("</html>"

---------------------------------------------------

 

It has been uploaded in ASCII mode via FTP. My local machine is windows. Anything that I did wrong to get that Internal server error

Posted

By the way I did what u said ...

Writing cgi.test() seems to make it work but then it also prints a lot of info.

 

I understand that it prints something that I need to write but I dont know what ... I am doing what is normally required to be done ... any ideas on that

 

 

Hey got it working .... :)

 

The issue was in Python 3 the braces are important

print ("Content-Type: text/html\n")

 

Thanks a lot .... sorted everything out ... just the semantic error of braces :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...