|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Keep Error 500, again URGENT |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|