从源代码配置 mod_wsgi 时出错
Error configuring mod_wsgi from source code
我正在尝试 ./configure
mod_wsgi 根据 these instructions 的源代码。总的来说,我正在尝试让 Django 在 Google 云计算引擎上与 Python3 和 Apache 一起工作。它使用的是 Debian 9。我从位于 /home/dhampton/anaconda3
.
的 Anaconda 安装了 Python 3.6
我 运行 遇到以下错误:
dhampton@blog-instance-1:~/mod_wsgi-4.5.20$ ./configure
checking for apxs2... no
checking for apxs... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/dhampton/mod_wsgi-4.5.20':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
dhampton@blog-instance-1:~/mod_wsgi-4.5.20$
以下是 config.log
文件中的内容:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = blog-instance-1
uname -m = x86_64
uname -r = 4.9.0-4-amd64
uname -s = Linux
uname -v = #1 SMP Debian 4.9.51-1 (2017-09-28)
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/dhampton/anaconda3/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1889: checking for apxs2
configure:1923: result: no
configure:1889: checking for apxs
configure:1923: result: no
configure:2009: checking for gcc
configure:2039: result: no
configure:2102: checking for cc
configure:2149: result: no
configure:2205: checking for cl.exe
configure:2235: result: no
configure:2259: error: in `/home/dhampton/mod_wsgi-4.5.20':
configure:2261: error: no acceptable C compiler found in $PATH
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
## ----------------- ##
## Output variables. ##
## ----------------- ##
APXS='apxs'
CC=''
CFLAGS=''
CPPFLAGS=''
DEFS=''
DESTDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
LDFLAGS=''
LDLIBS=''
LIBEXECDIR=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PYTHON=''
SHELL='/bin/bash'
ac_ct_CC=''
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 1
感谢任何帮助。谢谢。
好像你没有安装C编译器,安装gcc就可以解决问题
通过你的日志我可以看到你可能会发现很多依赖没有解决编译它(不仅仅是编译器)。
尝试使用以下命令找到与缺少的依赖项匹配的包:
$ apt-cache search apxs2
找到合适的包后安装:
$ sudo apt-get install apache2-dev
编译时,可能需要开发包,例如apache2-dev。正如之前的消息所说,你还需要一个编译器,所以安装 gcc:
$ sudo apt-get install gcc
也安装 binutils 包,以免看到许多消息而发疯:
$ sudo apt-get install binutils
顺便说一下,Debian 中有一个包可以让您的生活更轻松,所以如果您想避免编译它(并且不要执行前面的步骤),请尝试 运行 这样做:
$ sudo apt-get install libapache2-mod-wsgi-py3
我没有尝试过,但可能会按照您提供的指南中描述的一些配置进行 link。
祝你好运!
我正在尝试 ./configure
mod_wsgi 根据 these instructions 的源代码。总的来说,我正在尝试让 Django 在 Google 云计算引擎上与 Python3 和 Apache 一起工作。它使用的是 Debian 9。我从位于 /home/dhampton/anaconda3
.
我 运行 遇到以下错误:
dhampton@blog-instance-1:~/mod_wsgi-4.5.20$ ./configure
checking for apxs2... no
checking for apxs... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/dhampton/mod_wsgi-4.5.20':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
dhampton@blog-instance-1:~/mod_wsgi-4.5.20$
以下是 config.log
文件中的内容:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = blog-instance-1
uname -m = x86_64
uname -r = 4.9.0-4-amd64
uname -s = Linux
uname -v = #1 SMP Debian 4.9.51-1 (2017-09-28)
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/dhampton/anaconda3/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1889: checking for apxs2
configure:1923: result: no
configure:1889: checking for apxs
configure:1923: result: no
configure:2009: checking for gcc
configure:2039: result: no
configure:2102: checking for cc
configure:2149: result: no
configure:2205: checking for cl.exe
configure:2235: result: no
configure:2259: error: in `/home/dhampton/mod_wsgi-4.5.20':
configure:2261: error: no acceptable C compiler found in $PATH
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
## ----------------- ##
## Output variables. ##
## ----------------- ##
APXS='apxs'
CC=''
CFLAGS=''
CPPFLAGS=''
DEFS=''
DESTDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
LDFLAGS=''
LDLIBS=''
LIBEXECDIR=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PYTHON=''
SHELL='/bin/bash'
ac_ct_CC=''
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 1
感谢任何帮助。谢谢。
好像你没有安装C编译器,安装gcc就可以解决问题
通过你的日志我可以看到你可能会发现很多依赖没有解决编译它(不仅仅是编译器)。
尝试使用以下命令找到与缺少的依赖项匹配的包:
$ apt-cache search apxs2
找到合适的包后安装:
$ sudo apt-get install apache2-dev
编译时,可能需要开发包,例如apache2-dev。正如之前的消息所说,你还需要一个编译器,所以安装 gcc:
$ sudo apt-get install gcc
也安装 binutils 包,以免看到许多消息而发疯:
$ sudo apt-get install binutils
顺便说一下,Debian 中有一个包可以让您的生活更轻松,所以如果您想避免编译它(并且不要执行前面的步骤),请尝试 运行 这样做:
$ sudo apt-get install libapache2-mod-wsgi-py3
我没有尝试过,但可能会按照您提供的指南中描述的一些配置进行 link。
祝你好运!