我从https://code.google.com/p/modwsgi/source/checkout下载了mod_wsgi的最新源码,但我无法在 Windows 中使用 Apache 2.2 和 Python 3.2 编译它。有一些 undefined variable ,因为 MOD_WSGI_WITH_DAEMONS
未定义; MOD_WSGI_WITH_DAEMONS
未定义,因为 APR_HAS_FORK
为 0。
在“mod_wsgi.c”中:
#if APR_HAS_OTHER_CHILD && APR_HAS_THREADS && APR_HAS_FORK
#define MOD_WSGI_WITH_DAEMONS 1
#endif
...
#if defined(MOD_WSGI_WITH_DAEMONS)
...
static WSGIDaemonProcess *wsgi_daemon_process = NULL;
...
#endif
在“apr.h”中:
#define APR_HAS_FORK 0
我是否有机会使用适用于 Windows 的 Apache 2.2 和 Python 3.2 编译 mod_wsgi?如果是这样,怎么办?
更新:
在默认分支中,在“wsgi_apache.h”中:
#if (APR_MAJOR_VERSION == 0) && \
(APR_MINOR_VERSION == 9) && \
(APR_PATCH_VERSION < 5)
extern apr_status_t wsgi_apr_unix_file_cleanup(void *);
extern apr_status_t wsgi_apr_os_pipe_put_ex(apr_file_t **, apr_os_file_t *,
int, apr_pool_t *);
#define apr_unix_file_cleanup wsgi_apr_unix_file_cleanup
#define apr_os_pipe_put_ex wsgi_apr_os_pipe_put_ex
#endif
但是在“apr_version.h”中:
#define APR_MAJOR_VERSION 1
...
#define APR_MINOR_VERSION 4
...
#define APR_PATCH_VERSION 5
因此apr_unix_file_cleanup
将不会被定义。
我在 Windows 7 (x64) 中使用 Apache 2.2.22 和 Python 3.2.3。
最新的mod_wsgi-3.X可以编译为“.so”文件,但出现此错误:
mod_wsgi.so.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
我很担心这个。我不知道这是否是一个真正的问题。
而且,我无法加载 mod_wsgi 模块。 Apache 的错误日志显示:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: cp0
[Sat May 05 18:35:43 2012] [crit] (OS 1813)The specified resource type cannot be found in the image file. : master_main: create child process failed. Exiting.
我发现了这个:http://bugs.python.org/review/6501/diff/2518/6050 。它可能会导致该问题。我不确定。
最佳答案
使用最新的源代码重试。您可能还想暂时使用 3.X 分支而不是默认分支。
关于python - 如何在 Windows 上使用 Apache 2.2 和 Python 3.2 编译 mod_wsgi?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10458115/