简体   繁体   English

从源代码配置mod_wsgi时出错

[英]Error configuring mod_wsgi from source code

I'm trying to ./configure mod_wsgi from source code per these instructions . 我试图按照这些说明从源代码中进行./configure mod_wsgi。 Overall I'm trying to get Django working with Python3 and Apache on a Google Cloud Compute Engine. 总的来说,我正在尝试让Django在Google Cloud Compute Engine上使用Python3和Apache。 It's using Debian 9. I installed Python 3.6 from Anaconda located in /home/dhampton/anaconda3 . 它使用的是/home/dhampton/anaconda3 。我从/home/dhampton/anaconda3 Anaconda安装了Python 3.6。

I'm running into the following error: 我遇到以下错误:

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$

The following is what's in the config.log file: 以下是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

Any help is appreciated. 任何帮助表示赞赏。 Thanks. 谢谢。

好像您没有安装C编译器,安装gcc将解决问题

By your log I can see you will probably find a lot of dependencies not resolved to compile it (not only the compiler). 通过您的日志,我可以看到您可能会发现很多依赖项尚未解决,无法对其进行编译(不仅限于编译器)。

Try to find the package that match the missing dependency using for example the command: 尝试使用以下命令查找与缺少的依赖项匹配的软件包:

$ apt-cache search apxs2

And installing after you find the right package: 找到正确的软件包后进行安装:

$ sudo apt-get install apache2-dev

As you are compiling, probably you will need the development packages, it is for example apache2-dev. 在编译时,可能需要开发包,例如apache2-dev。 As the previous message said, you need a compiler too, so install gcc: 如上一条消息所述,您也需要编译器,因此请安装gcc:

$ sudo apt-get install gcc

Install too the binutils package to don't get crazy looking at many of the messages: 还要安装binutils软件包,以免疯狂地查看许多消息:

$ sudo apt-get install binutils

By the way, exist a package in Debian that could make your life easier, so if you want to avoid to compile it (and don't do the previous steps), try to run this: 顺便说一句,在Debian中存在一个可以简化您生活的软件包,因此,如果您要避免对其进行编译(并且不执行前面的步骤),请尝试运行此软件包:

$ sudo apt-get install libapache2-mod-wsgi-py3

I have not tried, but probably make some of the configurations described into the guide you provided as link. 我没有尝试过,但是可能会进行您作为链接提供的指南中描述的一些配置。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM