supernova15 / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Compiling mod_wsgi 3.4 - Apache 2.2.23 - Python 2.7.2 #272

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>> What steps will reproduce the problem?

cd path/to/mod_wsgi-3.4
nmake /f win32-ap22py27.mk

Before running the above command, modified the makefile with proper paths.

>>What is the expected output? What do you see instead?

Module should be loaded. While executing httpd.exe following error is given :

httpd.exe: Syntax error on line 130 of C:/apache/conf/httpd.conf: Cannot load 
C:/apache/modules/mod_wsgi.so into server: The specified module could not be 
found.

>> Please use labels and text to provide additional information.

mod_wsgi was compiled but the .so files is not detected by apache.

I know this error occurs when file isn't present in the modules folder of 
apache. But I am sure its present. Just to make sure that I am in right modules 
folder I renamed one of the module so it throws a similar error and it did. 

So I am guessing my mod_wsgi compilation went wrong. I don't know whether i 
missed something. I am providing the compile log attached with this. thanks in 
advance. 

Original issue reported on code.google.com by jigar.ti...@gmail.com on 16 Oct 2012 at 12:06

Attachments:

GoogleCodeExporter commented 9 years ago
This error generally arises for the following reasons.

1. Python was not installed for all users of system, but was only installed for 
the user that did the installation.
2. Apache, Python and mod_wsgi.so are not all 32 bit, or not all 64 bit. You 
cannot mix 32 and 64 bit versions, must all be the same.
3. If mod_wsgi.so was a binary, it is not the correct binary for Python version 
being used.

Original comment by Graham.Dumpleton@gmail.com on 16 Oct 2012 at 11:02

GoogleCodeExporter commented 9 years ago
Hi,

Thank you. I will cross check everything again and reply back.

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 4:03

GoogleCodeExporter commented 9 years ago
Thanks a lot. That helped. Python should be installed for all users. Exactly, 
python27.dll should be present in windows/system32. I get it now. Thanks.

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 6:04

GoogleCodeExporter commented 9 years ago
Doing install for all will also set global registry settings rather than just 
for user.

Original comment by Graham.Dumpleton@gmail.com on 17 Oct 2012 at 6:23

GoogleCodeExporter commented 9 years ago
Yes. 

Just one short question, Can I tell mod_wsgi.so to find python27.dll on other 
path other than windows/system32 ?

Or which registry does mod_wsgi read for python27.dll ?

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 6:26

GoogleCodeExporter commented 9 years ago
My non existent knowledge of Windows does sort of recollect that if you can set 
PATH of the Apache service to include the directory the DLL is in it will find 
it. The registry entries as I remember aren't for DLL location, but more to do 
with where the Python install directory is and Python module search path 
defaults. I think this talks about them.

http://effbot.org/zone/python-register.htm

But that is for really really old Python versions and could be different now.

Original comment by Graham.Dumpleton@gmail.com on 17 Oct 2012 at 6:40

GoogleCodeExporter commented 9 years ago
Got it. I want to skip using registry and environment variables actually. So 
the WSGI directive is best option to use here i guess. I added python27.dll in 
c:\python and added the following lines in httpd.conf.

WSGIPythonHome "C:\python"
WSGIPythonPath "C:\python\Lib;C:\python\Lib\site-packages;C:\python\DLLs"

This worked. I hope what I am doing is right. Well, at least I can see mod_wsgi 
loaded (shared) from "httpd.exe -D DUMP_MODULES" command. Please correct me if 
I am doing anything wrong.

I tested by commenting the WSGIPythonHome Line. httpd couldn't start. After 
removing the comment httpd again started. So I am assuming its right. :)

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 7:26

GoogleCodeExporter commented 9 years ago
That it couldn't start was not likely because of DLL as those directives can't 
replace how process finds DLL, so DLL must still be findable. Those settings 
could probably be used to replace registry settings though.

Original comment by Graham.Dumpleton@gmail.com on 17 Oct 2012 at 7:40

GoogleCodeExporter commented 9 years ago
Sorry. I was totally wrong. Just copying the DLL with httpd.exe worked. :D

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 9:13

GoogleCodeExporter commented 9 years ago
The same directory as httpd.exe is implicitly in PATH, so have it there and yes 
it should be found.

Original comment by Graham.Dumpleton@gmail.com on 17 Oct 2012 at 9:17

GoogleCodeExporter commented 9 years ago
Thanks a lot for your help.

Original comment by jigar.ti...@gmail.com on 17 Oct 2012 at 9:47

GoogleCodeExporter commented 9 years ago
Closing out old issue where no further action was required.

Original comment by Graham.Dumpleton@gmail.com on 12 Nov 2014 at 10:42