Help - Search - Members - Calendar
Full Version: Python
The Planet Forums > Control Panels > Plesk
miked
Hi,

I am having problems with Python on Plesk 7.5.3 server. On a domain i am trying to execute some python scripts from cgi-bin directory. But i am always getting 'Internal Server Error', when i check error log it says 'Premature end of script headers: test.py'. I know this type of problem is usually fixed with setting up correct permissions and making sure that files are uploaded in ASCII mode, and saved in Unix file format. I tried all possible combination that i could think of, and i cannot make it work. I cannot even make work simple hello world python script, witch works on non-plesk server. cgi-bin has 755 permission, and also all the scripts.

I am starting to think this is something related to plesk, but i am not sure. Does anyone have any idea what i can do to make this python scripts work?

Mike
Yivit
Mike,
I just tested this simple script on my Plesk server, and it works:
CODE
#!/usr/bin/python

print "Content-type: text/htmln"

print """

<html>

<head>

<title>test</title>

</head>

<body>

Hello World

</body>

</html>

"""

The script is saved as hello.py, with the appropriate ownerships and 755 mode, in /home/httpd/vhosts/domain.com/cgi-bin. mod_python support is enabled for the domain.
If you are still getting the error, even with this simple script and everything else set appropriately, check the log files for the domain in /home/httpd/vhosts/domain.com/statistics/logs. It sure smells like a stray character though.
miked
Thanks so much for this info. It now works for me to, i think my web browser has cached Internal Server Error page, because it started working after i restarted my local PC.

Mike.
Yivit
Heh, I've had that bite me enough times that I always set any browser I use to force-load every time.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.