Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,270 Programmers. There are 1,874 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Web browser displays source instead of output

 
Reply to this topicStart new topic

Web browser displays source instead of output

An_ant
post 9 Apr, 2008 - 01:33 AM
Post #1


New D.I.C Head

*
Joined: 9 Apr, 2008
Posts: 3



I'm doing Python CGI scripting and running my code on Xitami webserver. While the code works fine on Windows, on a Linux machine, the browser displays source instead of the output.

The code I'm using is just a sample. I'm getting the error using this itself.

CODE

#!/data01/space/project/python/bin/python

import cgi

print "Content-Type: text/html"     # HTML is following
print                               # blank line, end of headers

print "<TITLE>CGI script output</TITLE>"
print "<H1>This is my first CGI script</H1>"
print "Hello, world!"


Please help!!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


no2pencil
post 9 Apr, 2008 - 01:40 AM
Post #2


DIC K-mart

Group Icon
Joined: 10 May, 2007
Posts: 3,321

On the Linux machine, is the file set to executable permission?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

An_ant
post 9 Apr, 2008 - 01:47 AM
Post #3


New D.I.C Head

*
Joined: 9 Apr, 2008
Posts: 3

QUOTE(no2pencil @ 9 Apr, 2008 - 01:40 AM) *

On the Linux machine, is the file set to executable permission?



Thanks no2pencil.... it's working now.
By the way, can you suggest where I might find good documentation on Python CGI?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

no2pencil
post 9 Apr, 2008 - 02:31 AM
Post #4


DIC K-mart

Group Icon
Joined: 10 May, 2007
Posts: 3,321

QUOTE(An_ant @ 9 Apr, 2008 - 04:47 AM) *

Thanks no2pencil.... it's working now.

Was the executable permissions the issue?

QUOTE(An_ant @ 9 Apr, 2008 - 04:47 AM) *

By the way, can you suggest where I might find good documentation on Python CGI?

Sorry, I don't know Python. I know that there are some tutorials & snippets on this site, but I have not viewed them, so I don't know if they are CGI like you are looking for.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

An_ant
post 9 Apr, 2008 - 03:55 AM
Post #5


New D.I.C Head

*
Joined: 9 Apr, 2008
Posts: 3

QUOTE(no2pencil @ 9 Apr, 2008 - 02:31 AM) *

QUOTE(An_ant @ 9 Apr, 2008 - 04:47 AM) *

Thanks no2pencil.... it's working now.

Was the executable permissions the issue?

QUOTE(An_ant @ 9 Apr, 2008 - 04:47 AM) *

By the way, can you suggest where I might find good documentation on Python CGI?

Sorry, I don't know Python. I know that there are some tutorials & snippets on this site, but I have not viewed them, so I don't know if they are CGI like you are looking for.



Yes, it wasn't running because the files didn't have executable permissions.
Thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 10:33AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month