日安。我目前正在尝试使用XAMPP在本地托管Django网站。我学习过几个教程,但其中一个是这样的作品。我想知道你能不能告诉我,我错过了什么步骤,或者做错了什么。以下是在我的Django dev站点上安装的软件包的规范:
以下是我所遵循的程序:
我也试过
LoadModule mod_wsgi modules/mod_wsgi.so但仍然有相同的结果。XAMPP不显示任何错误,但即使在重新启动XAMPP和机器本身之后也不会运行Apache。我也曾尝试以管理员权限运行该应用程序,但它仍然不起作用。除了Apache之外,其他XAMPP模块都在工作。
发布于 2017-06-04 09:39:12
通过在作者的GitHub账户下载二进制文件并构建自己的二进制文件,我解决了这个问题。要做到这一点,我需要解压缩下载的zip文件并打开win32文件夹并阅读README.rst以获取说明。
摘录自说明书:
- Navigate back to the extracted mod\_wsgi file and find the appropriate makefile for your combination of Apache and Python (`ap22py27-win32-VC9.mk` in my case). If you are not sure your Apache version read this for [XAMPP](https://superuser.com/questions/791887/apache-version-in-xampp) or just navigate to localhost for WAMP.
- Edit the .mk file and define the correct path for APACHE\_ROOTDIR and PYTHON\_ROOTDIR. Example:APACHE_ROOTDIR = C:\xampp\apache
PYTHON_ROOTDIR = C:\Python27
-运行nmake -f apXYpyXY-winNN-VC?.mk install。在每种情况下用'XY‘代替使用的Apache和Python版本。将“NN”改为“32”或“64”,并以“?”加上'9‘或'10’。例子:nmake -f ap22py27-win32-VC9.mk install.该行为平台构建mod_wsgi,并将其安装到Apache安装的模块目录中。
-在WAMP/XAMPP http.conf中添加以下行:LoadModule wsgi_module modules/mod_wsgi.so和
WSGIPythonHome "C:/Python27"
WSGIPythonPath "ProjectPath"
WSGIApplicationGroup "%{GLOBAL}"
WSGIPassAuthorization "On"
-重新启动Apache或计算机,你就可以开始了。
注意:您不需要在python的已安装应用程序中添加mod_wsgi,因为它已经安装在Apache服务器中。
https://stackoverflow.com/questions/42546569
复制相似问题