我试图在我的本地计算机上运行Django 1.4.3项目,运行High Sierra的MacBook Pro和Mamp 4.5。该项目目前正在安装了Python2.6的Linux机器上运行。
Python2.6似乎已经过时了,所以我在本地的一个venv中使用Python2.7。
我已经使用此处的说明编译了一个新的wsgi_mod.so:
https://modwsgi.readthedocs.io/en/develop/user-guides/installation-on-macosx.html
我已将新文件复制到modules目录(移动了原始文件),但apache现在无法启动,我还注意到新文件的大小只有239b,原来是wsgi_mod.so,来自Mamp,是2.2米。
编辑:
当我跑步时:./configure --with-apxs=/Applications/MAMP/Library/bin/apxs
我收到以下错误:
checking Apache version... cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 217
如果我跑:./configure --with-apxs=/usr/local/bin/apxs --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
结果仍然相同,同样的小文件和apache不会启动。
我意识到我可以尝试从命令行启动apache,这将提供比图形MAMP工具更多的反馈:
正在运行/Applications/MAMP/Library/bin/apachectl start
httpd: Syntax error on line 132 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/Library/modules/mod_wsgi.so into server: dlopen(/Applications/MAMP/Library/modules/mod_wsgi.so, 10): Symbol not found: _ap_unixd_config\n Referenced from: /Applications/MAMP/Library/modules/mod_wsgi.so\n Expected in: flat namespace\n in /Applications/MAMP/Library/modules/mod_wsgi.so