尝试在 MAMP 中安装 mod_wsgi 时出现问题

发布于 2024-09-10 00:36:20 字数 933 浏览 4 评论 0原文

我使 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

然后我在 httpd.conf 中添加了以下内容:

LoadModule wsgi_module modules/mod_wsgi.so

最后,我为 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

I make mod_wsgi is like following

$./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

And then I copy file from /usr/local/apache2/modules/mod_wsgi.so to /Applications/MAMP/Library/modules/mod_wsgi.

Then I added the following in httpd.conf:

LoadModule wsgi_module modules/mod_wsgi.so

Finally, I star Apache and I get an error.

$ 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如若梦似彩虹 2024-09-17 00:36:20
  1. 确保您的版本 MAMP 是版本 2,因为它包含通用二进制安装程序(32 位和 64 位)。
  2. 修改你的Make文件并消除其他编译器版本,类似到:
    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
    
  3. 在 httpd.conf 中:
    LoadModule wsgi_module 模块/mod_wsgi.so
    
  1. Make sure your version of MAMP is Version 2 because it includes a Universal Binary installer (32-bit and 64-bit).
  2. Modify your Make file and eliminate the other compiler versions, similar to:
    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
    
  3. In httpd.conf:
    LoadModule wsgi_module modules/mod_wsgi.so
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文