我正在尝试在我的web服务器上安装Python 3.2和mod_wsgi,但我没有太多的运气。
我下载了Python源文件并使用以下命令进行编译:
./configure --enable-shared --prefix=/opt/python-3-2 LDFLAGS="-Wl,-rpath /opt/python-3-2/lib"
我还修改了我的pathvariables以包含/opt/python-3-2/bin并从/opt/python-3-2/bin/python创build了一个到python3二进制文件的符号链接。 现在,如果我从命令行运行python ,我会得到正确的提示。
> python Python 3.2.2 (default, Jan 20 2012, 18:14:20) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
我正在使用以下设置来编译最新版本的mod_wsgi
./configure --with-apxs=/usr/sbin/apxs --with-python=/opt/python-3-2/bin/python3
这会产生以下错误
mod_wsgi.c:8937: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8939: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8941: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8945: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8965: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8967: warning: suggest parentheses around assignment used as truth value mod_wsgi.c:8970: warning: suggest parentheses around assignment used as truth value mod_wsgi.c: In function 'wsgi_daemon_worker': mod_wsgi.c:10279: warning: unused variable 'duration' mod_wsgi.c:10278: warning: unused variable 'start' mod_wsgi.c: In function 'wsgi_hook_daemon_handler': mod_wsgi.c:12499: warning: unused variable 'i' mod_wsgi.c:12497: warning: unused variable 'elts' mod_wsgi.c:12496: warning: unused variable 'head' mod_wsgi.c: In function 'Auth_environ': mod_wsgi.c:13375: warning: assignment makes pointer from integer without a cast mod_wsgi.c: At top level: mod_wsgi.c:7154: warning: 'wsgi_set_py3k_warning_flag' defined but not used mod_wsgi.c:7856: warning: 'wsgi_set_user_authoritative' defined but not used mod_wsgi.c:14414: warning: 'wsgi_hook_check_user_id' defined but not used /usr/lib/apr-1/build/libtool --silent --mode=link gcc -o mod_wsgi.la -rpath /usr/lib/httpd/modules -module -avoid-version mod_wsgi.lo -L/opt/python-3-2/lib -L/opt/python-3-2/lib/python3.2/config -lpython3.2 -lpthread -ldl -lutil -lm /usr/bin/ld: cannot find -lpython3.2 collect2: ld returned 1 exit status apxs:Error: Command failed with rc=65536
我试图从/opt/python-3-2/lib/python3.2/config -> /opt/python-3-2/lib/libpython3.so创build一个符号链接,但是没有帮助。
您目前必须使用Python 3.2源代码库中的mod_wsgi源代码,您不能使用mod_wsgi 3.3源代码。