Python FCGI script errors


#1

Hi, I have a Python FCGI script on my server which gives me an “Internal Server Error”. I got the script from
The script looks like this:

[code]#!/usr/bin/python2.4
from flup.server.fcgi import WSGIServer
def test_app(environ, start_response):
start_response(‘200 OK’, [(‘Content-Type’, ‘text/plain’)])
yield ‘Hello, world!\n’

WSGIServer(test_app).run()[/code]When I run the script from the ssh shell I get the following errors:

[silk]$ bash ~/cpufreak91.net/hello.fcgi from: can't read /var/mail/flup.server.fcgi /home/cpufreak91/cpufreak91.net/hello.fcgi: line 3: syntax error near unexpected token `(' /home/cpufreak91/cpufreak91.net/hello.fcgi: line 3: `def test_app(environ, start_response):'(Also, Dreamhost set up my site’s memory restriction to be compatible with Python/FastCGI)

Is there anything that I am forgetting or doing wrong?

All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.’’ – Tao of Programming Book 2


#2

It looks like a python issue. I created a new fcgi script and just put a function in it, nothing else. When I ran bash tmp.fcgi I immediately got the same syntax error. Is there’s something I’ve forgotten to configure?

All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.’’ – Tao of Programming Book 2


#3

same problem my friend, and I can’t get DreamHost Support to respond. http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_troubleshooting&Number=70110&page=0&view=collapsed&sb=5&o=14&part=

I have my site memory restriction to be compatible with Python/FastCGI. I have followed the instructions on the support wiki and my site still isn’t working. Any ideas on how to get DH to look into our env?

:~/trianglewiki.org$ bash default.fcgi
default.fcgi: line 3: syntax error near unexpected token (' default.fcgi: line 3:def myapp(environ, start_response):’


#4

CPUFreak91, ask DreamHost to take a look at “raising the Apache softlimit” Things work for me now.


#5

CPUFreak91, ask DreamHost to take a look at "raising the Apache softlimit" Things work for me now.I have, but I still get the same error. :frowning:

All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.’’ – Tao of Programming Book 2


#6

Aha! I think I’ve got it!
Go to http://wiki.dreamhost.com/index.php/Python_FastCGI and read the “Quirks” section. Hope this helps.

All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.’’ – Tao of Programming Book 2