我正在使用 mod_wsgi 运行Django + httpd。
我已经阅读了文档并根据需要配置了 httpd.conf。我在 Centos5.5 上运行 Python2.7
我收到一个奇怪的“语法”错误,对我来说这看起来像是版本冲突。任何指针?
这是我的 Apache 错误日志:
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] mod_wsgi (pid=32765): Target WSGI script '/home/sbose/PATH/TO/wsgi.py' cannot be loaded as Python module.
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] mod_wsgi (pid=32765): Exception occurred processing WSGI script '/home/sbose/PATH/TO/wsgi.py'.
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] Traceback (most recent call last):
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] File "/home/sbose/PATH/TO/wsgi.py", line 10, in ?
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] import django.core.handlers.wsgi
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 84
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] self.buffer = b''
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] ^
[Tue Aug 27 19:12:01 2013] [error] [client 10.104.22.85] SyntaxError: invalid syntax
更新: 我刚刚发现 Apache 正在运行 Python2.4 另外,仅供参考,我已经用 yum 安装了 mod_wsgi。
谢谢。