开发者

mod_wsgi problem with MAMP

开发者 https://www.devze.com 2023-01-08 00:04 出处:网络
I ma开发者_如何转开发ke mod_wsgi is like following $./configure --with-python=/Library/Frameworks/Python.framework/Versions/2.7/bin/python

I ma开发者_如何转开发ke 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.so

And then I add

LoadModule wsgi_module modules/mod_wsgi.so

in httpd.conf

I run the apache and I got 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


Step 1: Make sure your version of MAMP is Version 2 because it includes a Universal Binary installer (32-bit & 64-bit)

Step 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

Step 3: In httpd.conf: LoadModule wsgi_module modules/mod_wsgi.so

0

精彩评论

暂无评论...
验证码 换一张
取 消