如何在从 xampp 软件包安装的 apache 服务器上安装 mod_wsgi?

How do I install mod_wsgi on my apache server installed from xampp package?

我下载了 mod_wsgi 包,但在配置 make 文件时遇到了问题。我使用的命令是 sudo ./configure --with-apxs=/opt/lampp/bin/apxs。我收到了以下消息。

./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for prctl... yes
checking Apache version... ./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
./configure: line 2769: /: Is a directory

checking for python... /usr/bin/python
./configure: /opt/lampp/bin/apxs: /bin/perl: bad interpreter: No such file or directory
configure: creating ./config.status
config.status: creating Makefile

所以我将 apxs 文件的第一个赞从 /bin/perl 更改为 /usr/bin/perl

然后我在 运行 sudo ./configure --with-apxs=/opt/lampp/bin/apxs.

时得到了这个
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for prctl... yes
checking Apache version... 2.4.41
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile

现在当我 我得到

/opt/lampp/bin/apxs -c -I/usr/include/python2.7 -DNDEBUG -D_FORTIFY_SOURCE=2  -Wc,-g -Wc,-O2  src/server/mod_wsgi.c src/server/wsgi_*.c -L/usr/lib -L/usr/lib/python2.7/config  -lpython2.7 -lpthread -ldl  -lutil -lm
/opt/lampp/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -I/opt/lampp/include/c-client -I/opt/lampp/include/libpng -I/opt/lampp/include/freetype2 -O3 -L/opt/lampp/lib -I/opt/lampp/include -I/opt/lampp/include/ncurses  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/opt/lampp/include  -I/opt/lampp/include/apr-1   -I/opt/lampp/include/apr-1 -I/opt/lampp/include -g -O2 -I/usr/include/python2.7 -DNDEBUG -D_FORTIFY_SOURCE=2  -c -o src/server/mod_wsgi.lo src/server/mod_wsgi.c && touch src/server/mod_wsgi.slo
/opt/lampp/build/libtool: 1555: /opt/lampp/build/libtool: preserve_args+= --silent: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= gcc: not found
/opt/lampp/build/libtool: 2419: /opt/lampp/build/libtool: later+= -prefer-pic: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -std=gnu99: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/c-client: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/libpng: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/freetype2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -O3: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -L/opt/lampp/lib: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/ncurses: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -DLINUX: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_REENTRANT: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_GNU_SOURCE: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -pthread: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/apr-1: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include/apr-1: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/opt/lampp/include: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -g: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -O2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -I/usr/include/python2.7: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -DNDEBUG: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -D_FORTIFY_SOURCE=2: not found
/opt/lampp/build/libtool: 1: eval: base_compile+= -c: not found
libtool: compile: you must specify a compilation command
libtool: compile: Try `libtool --help --mode=compile' for more information.
apxs:Error: Command failed with rc=65536
.
Makefile:31: recipe for target 'src/server/mod_wsgi.la' failed
make: *** [src/server/mod_wsgi.la] Error 1

我试过安装 libtool,但没有用。

请帮我解决这个问题,或者让我知道适合您的方法。

这是由于 Xampp 的旧版本。尝试更新 xampp。或者你可以把第一行/opt/lampp/build/libtool/bin/sh

改成/bin/bash