Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 11th, 2004, 06:20 PM
kenahans kenahans is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 kenahans User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Keep Error 500, again URGENT

I have written this SIMPLE code:
#!/usr/bin/python2

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

print """
<html>
<head><title> Dette må virke</title></head>
<body>
<h1>Please se dette da . pleeeeeeeeaseeeeeeeee</h1>
</body>
</html>
"""

And i have put the chmod 755 on the file and still get no result. What is wrong.

Reply With Quote
  #2  
Old May 11th, 2004, 08:39 PM
sfb sfb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 447 sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level)sfb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 1 h 43 m 45 sec
Reputation Power: 9
Put
Code:
import cgi
import cgitb; cgitb.enable()


At the top of the script.
Also, run it from the command line, if there are any syntax errors, that will find them.

Reply With Quote
  #3  
Old May 12th, 2004, 03:47 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,243 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 5 h 41 m 59 sec
Reputation Power: 265
Two other common problems to check for:

1) the python program is not where the #! at the start of the script says it is. In the code that you post, the python executable is "python2" - is the 2 supposed to be there?

2) editing the python script on a Windows system, then running it on UNIX without stripping out the carriage returns.

Both of these will cause the server to barf before the script is executed, so it will not make any difference what is in the script.

If you can, check the server error logs. This will give you more information about what went wrong.

Dave - The Developers' Coach

Last edited by DevCoach : May 12th, 2004 at 03:50 AM.

Reply With Quote
  #4  
Old May 14th, 2004, 04:48 PM
sadrok sadrok is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: South Africa
Posts: 9 sadrok User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Your problem might be the å character.
This causes the following error on my system:
Code:
sys:1: DeprecationWarning: Non-ASCII character '\xc3' in file ./test.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

This may just as well cause the 500 error.
Try adding this line under the #! line
Code:
#!/usr/bin/python2
# -*- Encoding: latin-1 -*-

You can exchange latin-1 with utf-8 depending on the program you are using to edit the file and the encoding it uses.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Keep Error 500, again URGENT


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT