gpt4 book ai didi

python - MAMP 的 mod_wsgi 问题

转载 作者:太空宇宙 更新时间:2023-11-04 06:39:20 24 4
gpt4 key购买 nike

我使 mod_wsgi 如下所示

$./configure --with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python --with-apxs=/usr/local/apache2/bin/apxs

checking Apache version... 2.0.63

configure: creating ./config.status

config.status: creating Makefile

$sudo make $sudo make install

然后我将文件从/usr/local/apache2/modules/mod_wsgi.so 复制到/Applications/MAMP/Library/modules/mod_wsgi.so

然后我添加

LoadModule wsgi_module modules/mod_wsgi.so

在 httpd.conf 中

我运行 apache 时出现错误。

$ sudo /Applications/MAMP/Library/bin/apachectl start

Syntax error on line 287 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/Library/modules/mod_wsgi.so into server: cannot create object file image or add library

最佳答案

第 1 步:确保您的 MAMP is Version 2 版本因为它包含一个通用二进制安装程序(32 位和 64 位)

第 2 步:Modify your Make file并消除其他编译器版本,类似于:

CPPFLAGS = -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DNDEBUG 
CFLAGS = -Wc,"-arch i386" -Wc,"-arch x86_64" -Wc
LDFLAGS = -arch i386 -arch x86_64 -F/Library/Frameworks -framework Python -u _PyMac_Error
LDLIBS = -ldl -framework CoreFoundation

第三步:在httpd.conf中:LoadModule wsgi_module modules/mod_wsgi.so

关于python - MAMP 的 mod_wsgi 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3257496/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com