Windows 7, Apache, Python 3.2, mod_wsgi installation and configuration

1,288 views
Skip to first unread message

Michael Benin

unread,
Aug 17, 2011, 7:04:10 PM8/17/11
to mod...@googlegroups.com
Dear modwsgi group,

My machine is running Windows 7 64bit.

I have installed and configured Apache with httpd-2.2.19-win32-x86-no_ssl.msi and have PHP installed with php-5.3.6-Win32-VC9-x86.msi. 

Python 3.2 is installed from python-3.2.1.msi (I could not open as administrator, after reading installation instructions recommending installing python as administrator, from the desktop it was installed utilizing cmd.exe running the command:

/a "python-3.2.1.msi

I downloaded: mod_wsgi-win32-ap22py31-3.3 from google's wsgi downloads and renamed it mod_wsgi.so, proceeded to copy it to my modules folder under apache. And added the line:

LoadModule wsgi_module modules/mod_wsgi.so

-To the httpd.conf in Apache. 

In control panel services I restarted Apache. 


Error message:

"Windows could not start the Apache2.2 on Local Computer. For more information review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service specific error code 1."

I am currently watching this video to figure out the problem: http://blip.tv/pycon-australia/getting-started-with-apache-mod_wsgi-3859481

Any help is greatly appreciated. Thank you. 

-- 
Michael Benin
 

Michael Benin

unread,
Aug 17, 2011, 7:19:49 PM8/17/11
to mod...@googlegroups.com
Event Log: 

"The Apache service named  reported the following error:
>>> httpd.exe: Syntax error on line 129 of C:/apache/conf/httpd.conf: Cannot load C:/apache/modules/mod_wsgi.so into server: The specified module could not be found. "

Manuel Antonio Mora Sandoval

unread,
Aug 17, 2011, 10:09:13 PM8/17/11
to mod...@googlegroups.com
Hi Michael, I use python 3.2 under Linux 64 bits, but for I can use, I need download the source and compile him. I reviewed the source and I see that version is 4. So that You wait to a new release comming soon.

2011/8/17 Michael Benin <beninm...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To post to this group, send email to mod...@googlegroups.com.
To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.

Michael Benin

unread,
Aug 17, 2011, 11:25:30 PM8/17/11
to mod...@googlegroups.com
What program is needed to compile for windows?

7zip and Cygwin?

Douglas Epling

unread,
Aug 18, 2011, 9:37:50 PM8/18/11
to mod...@googlegroups.com
You can get the Microsoft Visual Studio C/C++ compiler free from Microsoft.  It does not have all the features, but it will do a command line compile.  I forget what the compiler name is, i.e.  $:gcc source.c under linux.
Douglas Epling
President/Owner
YourHelpDesk.us, LLC


Graham Dumpleton

unread,
Aug 18, 2011, 9:48:56 PM8/18/11
to mod...@googlegroups.com
See:

http://code.google.com/p/modwsgi/wiki/InstallationOnWindows

You will need to make a copy of:

win32-ap22py31.mk

to win32-ap22py32.mk and adjust paths defined in the file for Python 3.2.

Sorry, been a bit busy to follow this conversation too closely.

Graham

Michael Benin

unread,
Aug 20, 2011, 4:43:50 PM8/20/11
to mod...@googlegroups.com
Thank you for pointing me in the right direction. 

Other information to be provided:

I have apache installed under c:\apache
I have Python installed under c:\Python32


-Downloaded Visual Studio
-Renamed the file to win32-ap22py32.mk
-Opened it with Visual Studio:
-Modified these directories:

CPPFLAGS = \
 /DWIN32 \
 /DNDEBUG \
 /I"c:\Program Files\Microsoft Visual Studio 9.0\VC\include" \
 /I"c:\Program Files\Microsoft SDKs\Windows\v6.0A\Include" \
 /I"c:\apache\include" \
 /I"c:\Python32\include"

CFLAGS = \
 /MD \
 /GF \
 /Gy \
 /O2 \
 /Wall \
 /Zc:wchar_t \
 /Zc:forScope

LDFLAGS = \
 /link \
 "/LIBPATH:c:\Program Files\Microsoft Visual Studio 9.0\VC\lib" \
 "/LIBPATH:c:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" \
 "/LIBPATH:c:\apache\lib" \
 /LIBPATH:c:\Python32\libs \
 /OPT:REF \
 /OPT:ICF=2 \
 /RELEASE \
 /SUBSYSTEM:WINDOWS

LDLIBS = \
 python32.lib \
 libhttpd.lib \
 libapr-1.lib \
 libaprutil-1.lib

mod_wsgi.so : mod_wsgi.c
cl $(CPPFLAGS) $(CFLAGS) $? /LD $(LDFLAGS) $(LDLIBS) /OUT:$@
        mt -manifest $@.manifest -outputresource:$@;2

clean :
del *.obj *.so *.so.manifest *.lib *.exp

From there I opened Visual Studio Command Prompt as administrator, and cd to the directory where the file is, ran the command:
nmake -f win32-ap22py31.mk
I received the following error:

cannot open the include file 'httpd.h' no such file or directory.

I believe the other directories need to be modified- specifically  libhttpd.lib \

Once again I appreciate all the help and will document a wiki on this. I am a junior web developer who mainly works with JS, AS3, and PHP. Ultimately I would like to make xmlhttprequests (AJAX) for a thick client web app, utilizing JS or AS3 on the front end and have Python work with mongoDB on the backend. I have been learning Python 3.2 using Pydev and would really love to make it come alive in my web apps. 

Michael Benin

unread,
Aug 20, 2011, 4:44:58 PM8/20/11
to mod...@googlegroups.com
*nmake -f win32-ap22py32.mk

Graham Dumpleton

unread,
Aug 20, 2011, 5:59:50 PM8/20/11
to mod...@googlegroups.com
When you install Apache you must tick the box to say to install development header files. I don't believe they are installed by default.


On Sunday, 21 August 2011, Michael Benin <beninm...@gmail.com> wrote:
> Thank you for pointing me in the right direction. 
> Other information to be provided:
> I have apache installed under c:\apache
> I have Python installed under c:\Python32
>
> -Downloaded Visual Studio
> -Renamed the file to win32-ap22py32.mk <http://win32-ap22py32.mk/>
>>>> To post to this group, send email to modwsgi@goog

Graham Dumpleton

unread,
Aug 20, 2011, 6:00:33 PM8/20/11
to mod...@googlegroups.com
When you install Apache you must tick the box to say to install development header files. I don't believe they are installed by segault


On Sunday, 21 August 2011, Michael Benin <beninm...@gmail.com> wrote:
> Thank you for pointing me in the right direction. 
> Other information to be provided:
> I have apache installed under c:\apache
> I have Python installed under c:\Python32
>
> -Downloaded Visual Studio
> -Renamed the file to win32-ap22py32.mk <http://win32-ap22py32.mk/>
>>>>> (845) 380-2700 <tel:%28845%29%20380-2700>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Benin
>>>> (845) 380-2700 <tel:%28845%29%20380-2700>

>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "modwsgi" group.
>>>> To post to this group, send email to modwsgi@goog

Michael Benin

unread,
Aug 21, 2011, 10:58:42 AM8/21/11
to mod...@googlegroups.com
-Reinstalled Apache with Headers

Thank you for your patience.

Utilizing the same process before I was able to get passed that error with mod_wsgi.exp, mod_wsgi.lib, and mod_wsgi.obj but it did not output a .so.

Output inside of the Visual Studio Command Prompt:



mod_wsgi.c(6573) : warning C4127: conditional expression is constant
mod_wsgi.c(6576) : warning C4127: conditional expression is constant
mod_wsgi.c(6576) : warning C4127: conditional expression is constant
mod_wsgi.c(6577) : warning C4127: conditional expression is constant
mod_wsgi.c(6577) : warning C4127: conditional expression is constant
mod_wsgi.c(6584) : warning C4127: conditional expression is constant
mod_wsgi.c(6584) : warning C4127: conditional expression is constant
mod_wsgi.c(6605) : warning C4127: conditional expression is constant
mod_wsgi.c(6605) : warning C4127: conditional expression is constant
mod_wsgi.c(6669) : warning C4127: conditional expression is constant
mod_wsgi.c(6622) : warning C4100: 'data' : unreferenced formal parameter
mod_wsgi.c(6762) : warning C4127: conditional expression is constant
mod_wsgi.c(6831) : warning C4127: conditional expression is constant
mod_wsgi.c(6855) : warning C4127: conditional expression is constant
mod_wsgi.c(6880) : warning C4127: conditional expression is constant
mod_wsgi.c(6880) : warning C4127: conditional expression is constant
mod_wsgi.c(6690) : warning C4189: 'interp' : local variable is initialized but n
ot referenced
mod_wsgi.c(6792) : warning C4189: 'l' : local variable is initialized but not re
ferenced
mod_wsgi.c(6925) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7086) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7108) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7127) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7152) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7174) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7190) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7206) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7222) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7238) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7265) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7287) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7309) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7331) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7440) : warning C4100: 'mconfig' : unreferenced formal parameter
mod_wsgi.c(7443) : warning C4189: 'error' : local variable is initialized but no
t referenced
mod_wsgi.c(7854) : warning C4100: 'cmd' : unreferenced formal parameter
mod_wsgi.c(7870) : warning C4100: 'cmd' : unreferenced formal parameter
mod_wsgi.c(7890) : warning C4189: 'sconfig' : local variable is initialized but
not referenced
mod_wsgi.c(7891) : warning C4189: 'dconfig' : local variable is initialized but
not referenced
mod_wsgi.c(8124) : warning C4189: 'c' : local variable is initialized but not re
ferenced
mod_wsgi.c(8288) : warning C4127: conditional expression is constant
mod_wsgi.c(8326) : warning C4127: conditional expression is constant
mod_wsgi.c(8346) : warning C4127: conditional expression is constant
mod_wsgi.c(8354) : warning C4127: conditional expression is constant
mod_wsgi.c(8372) : warning C4047: '=' : 'PyObject *' differs in levels of indire
ction from 'int'
mod_wsgi.c(8374) : warning C4127: conditional expression is constant
mod_wsgi.c(8490) : warning C4127: conditional expression is constant
mod_wsgi.c(8513) : warning C4127: conditional expression is constant
mod_wsgi.c(8643) : warning C4127: conditional expression is constant
mod_wsgi.c(8644) : warning C4127: conditional expression is constant
mod_wsgi.c(8676) : warning C4127: conditional expression is constant
mod_wsgi.c(8699) : warning C4127: conditional expression is constant
mod_wsgi.c(8705) : warning C4127: conditional expression is constant
mod_wsgi.c(8722) : warning C4127: conditional expression is constant
mod_wsgi.c(8723) : warning C4127: conditional expression is constant
mod_wsgi.c(8755) : warning C4127: conditional expression is constant
mod_wsgi.c(8778) : warning C4127: conditional expression is constant
mod_wsgi.c(8784) : warning C4127: conditional expression is constant
mod_wsgi.c(8811) : warning C4127: conditional expression is constant
mod_wsgi.c(8814) : warning C4127: conditional expression is constant
mod_wsgi.c(8814) : warning C4127: conditional expression is constant
mod_wsgi.c(8815) : warning C4127: conditional expression is constant
mod_wsgi.c(8815) : warning C4127: conditional expression is constant
mod_wsgi.c(8819) : warning C4127: conditional expression is constant
mod_wsgi.c(8826) : warning C4127: conditional expression is constant
mod_wsgi.c(8832) : warning C4127: conditional expression is constant
mod_wsgi.c(8832) : warning C4127: conditional expression is constant
mod_wsgi.c(12910) : warning C4100: 'plog' : unreferenced formal parameter
mod_wsgi.c(12909) : warning C4100: 'ptemp' : unreferenced formal parameter
mod_wsgi.c(13009) : warning C4100: 's' : unreferenced formal parameter
mod_wsgi.c(13097) : warning C4242: '=' : conversion from 'int' to 'char', possib
le loss of data
mod_wsgi.c(13131) : warning C4127: conditional expression is constant
mod_wsgi.c(13171) : warning C4127: conditional expression is constant
mod_wsgi.c(13181) : warning C4127: conditional expression is constant
mod_wsgi.c(13196) : warning C4127: conditional expression is constant
mod_wsgi.c(13207) : warning C4127: conditional expression is constant
mod_wsgi.c(13220) : warning C4127: conditional expression is constant
mod_wsgi.c(13229) : warning C4127: conditional expression is constant
mod_wsgi.c(13239) : warning C4127: conditional expression is constant
mod_wsgi.c(13249) : warning C4127: conditional expression is constant
mod_wsgi.c(13259) : warning C4127: conditional expression is constant
mod_wsgi.c(13270) : warning C4127: conditional expression is constant
mod_wsgi.c(13282) : warning C4127: conditional expression is constant
mod_wsgi.c(13292) : warning C4127: conditional expression is constant
mod_wsgi.c(13303) : warning C4127: conditional expression is constant
mod_wsgi.c(13312) : warning C4127: conditional expression is constant
mod_wsgi.c(13321) : warning C4127: conditional expression is constant
mod_wsgi.c(13330) : warning C4127: conditional expression is constant
mod_wsgi.c(13339) : warning C4127: conditional expression is constant
mod_wsgi.c(13347) : warning C4127: conditional expression is constant
mod_wsgi.c(13355) : warning C4127: conditional expression is constant
mod_wsgi.c(13359) : warning C4127: conditional expression is constant
mod_wsgi.c(13375) : warning C4047: '=' : 'PyObject *' differs in levels of indir
ection from 'int'
mod_wsgi.c(13377) : warning C4127: conditional expression is constant
mod_wsgi.c(13492) : warning C4127: conditional expression is constant
mod_wsgi.c(13515) : warning C4127: conditional expression is constant
mod_wsgi.c(13561) : warning C4127: conditional expression is constant
mod_wsgi.c(13562) : warning C4127: conditional expression is constant
mod_wsgi.c(13563) : warning C4127: conditional expression is constant
mod_wsgi.c(13581) : warning C4127: conditional expression is constant
mod_wsgi.c(13606) : warning C4127: conditional expression is constant
mod_wsgi.c(13609) : warning C4127: conditional expression is constant
mod_wsgi.c(13609) : warning C4127: conditional expression is constant
mod_wsgi.c(13610) : warning C4127: conditional expression is constant
mod_wsgi.c(13610) : warning C4127: conditional expression is constant
mod_wsgi.c(13614) : warning C4127: conditional expression is constant
mod_wsgi.c(13617) : warning C4127: conditional expression is constant
mod_wsgi.c(13636) : warning C4127: conditional expression is constant
mod_wsgi.c(13636) : warning C4127: conditional expression is constant
mod_wsgi.c(13707) : warning C4127: conditional expression is constant
mod_wsgi.c(13730) : warning C4127: conditional expression is constant
mod_wsgi.c(13776) : warning C4127: conditional expression is constant
mod_wsgi.c(13777) : warning C4127: conditional expression is constant
mod_wsgi.c(13778) : warning C4127: conditional expression is constant
mod_wsgi.c(13802) : warning C4127: conditional expression is constant
mod_wsgi.c(13818) : warning C4127: conditional expression is constant
mod_wsgi.c(13843) : warning C4127: conditional expression is constant
mod_wsgi.c(13846) : warning C4127: conditional expression is constant
mod_wsgi.c(13846) : warning C4127: conditional expression is constant
mod_wsgi.c(13847) : warning C4127: conditional expression is constant
mod_wsgi.c(13847) : warning C4127: conditional expression is constant
mod_wsgi.c(13851) : warning C4127: conditional expression is constant
mod_wsgi.c(13854) : warning C4127: conditional expression is constant
mod_wsgi.c(13873) : warning C4127: conditional expression is constant
mod_wsgi.c(13873) : warning C4127: conditional expression is constant
mod_wsgi.c(13949) : warning C4127: conditional expression is constant
mod_wsgi.c(13972) : warning C4127: conditional expression is constant
mod_wsgi.c(14018) : warning C4127: conditional expression is constant
mod_wsgi.c(14019) : warning C4127: conditional expression is constant
mod_wsgi.c(14020) : warning C4127: conditional expression is constant
mod_wsgi.c(14051) : warning C4127: conditional expression is constant
mod_wsgi.c(14058) : warning C4127: conditional expression is constant
mod_wsgi.c(14074) : warning C4127: conditional expression is constant
mod_wsgi.c(14086) : warning C4127: conditional expression is constant
mod_wsgi.c(14089) : warning C4127: conditional expression is constant
mod_wsgi.c(14101) : warning C4127: conditional expression is constant
mod_wsgi.c(14126) : warning C4127: conditional expression is constant
mod_wsgi.c(14129) : warning C4127: conditional expression is constant
mod_wsgi.c(14129) : warning C4127: conditional expression is constant
mod_wsgi.c(14130) : warning C4127: conditional expression is constant
mod_wsgi.c(14130) : warning C4127: conditional expression is constant
mod_wsgi.c(14134) : warning C4127: conditional expression is constant
mod_wsgi.c(14137) : warning C4127: conditional expression is constant
mod_wsgi.c(14156) : warning C4127: conditional expression is constant
mod_wsgi.c(14156) : warning C4127: conditional expression is constant
mod_wsgi.c(14226) : warning C4127: conditional expression is constant
mod_wsgi.c(14249) : warning C4127: conditional expression is constant
mod_wsgi.c(14295) : warning C4127: conditional expression is constant
mod_wsgi.c(14296) : warning C4127: conditional expression is constant
mod_wsgi.c(14297) : warning C4127: conditional expression is constant
mod_wsgi.c(14317) : warning C4127: conditional expression is constant
mod_wsgi.c(14342) : warning C4127: conditional expression is constant
mod_wsgi.c(14345) : warning C4127: conditional expression is constant
mod_wsgi.c(14345) : warning C4127: conditional expression is constant
mod_wsgi.c(14346) : warning C4127: conditional expression is constant
mod_wsgi.c(14346) : warning C4127: conditional expression is constant
mod_wsgi.c(14350) : warning C4127: conditional expression is constant
mod_wsgi.c(14353) : warning C4127: conditional expression is constant
mod_wsgi.c(14372) : warning C4127: conditional expression is constant
mod_wsgi.c(14372) : warning C4127: conditional expression is constant
mod_wsgi.c(14476) : warning C4127: conditional expression is constant
mod_wsgi.c(14499) : warning C4127: conditional expression is constant
mod_wsgi.c(14545) : warning C4127: conditional expression is constant
mod_wsgi.c(14546) : warning C4127: conditional expression is constant
mod_wsgi.c(14547) : warning C4127: conditional expression is constant
mod_wsgi.c(14584) : warning C4127: conditional expression is constant
mod_wsgi.c(14609) : warning C4127: conditional expression is constant
mod_wsgi.c(14612) : warning C4127: conditional expression is constant
mod_wsgi.c(14612) : warning C4127: conditional expression is constant
mod_wsgi.c(14613) : warning C4127: conditional expression is constant
mod_wsgi.c(14613) : warning C4127: conditional expression is constant
mod_wsgi.c(14617) : warning C4127: conditional expression is constant
mod_wsgi.c(14620) : warning C4127: conditional expression is constant
mod_wsgi.c(14639) : warning C4127: conditional expression is constant
mod_wsgi.c(14639) : warning C4127: conditional expression is constant
mod_wsgi.c(14800) : warning C4127: conditional expression is constant
mod_wsgi.c(14788) : warning C4100: 's' : unreferenced formal parameter
mod_wsgi.c(14788) : warning C4100: 'plog' : unreferenced formal parameter
mod_wsgi.c(14787) : warning C4100: 'ptemp' : unreferenced formal parameter
mod_wsgi.c(14787) : warning C4100: 'pconf' : unreferenced formal parameter
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(340) : warning
 C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(717) : warning
 C4711: function 'newWSGIDirectoryConfig' selected for automatic inline expansio
n
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(729) : warning
 C4711: function 'newWSGIDirectoryConfig' selected for automatic inline expansio
n
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(1658) : warnin
g C4711: function 'Log_call' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(1672) : warnin
g C4711: function 'Log_call' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(1762) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(1765) : warnin
g C4711: function 'Log_write' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(2705) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(2891) : warnin
g C4711: function 'newInputObject' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(3852) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(3844) : warnin
g C4711: function 'Adapter_process_file_wrapper' selected for automatic inline e
xpansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(4524) : warnin
g C4711: function 'newRestrictedObject' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(4535) : warnin
g C4711: function 'newRestrictedObject' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(6359) : warnin
g C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(6607) : warnin
g C4711: function 'wsgi_release_interpreter' selected for automatic inline expan
sion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(6814) : warnin
g C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(6844) : warnin
g C4711: function 'wsgi_reload_required' selected for automatic inline expansion

c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(6882) : warnin
g C4711: function 'wsgi_release_interpreter' selected for automatic inline expan
sion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(7544) : warnin
g C4711: function 'newWSGIScriptFile' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(7743) : warnin
g C4711: function 'newWSGIScriptFile' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(7783) : warnin
g C4711: function 'newWSGIScriptFile' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(7823) : warnin
g C4711: function 'newWSGIScriptFile' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(7903) : warnin
g C4711: function 'newWSGIScriptFile' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8472) : warnin
g C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8937) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8939) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8941) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8945) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8965) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8967) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8970) : warnin
g C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(8894) : warnin
g C4711: function 'wsgi_is_script_aliased' selected for automatic inline expansi
on
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(13474) : warni
ng C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(13689) : warni
ng C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(14033) : warni
ng C4706: assignment within conditional expression
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(13931) : warni
ng C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(14208) : warni
ng C4711: function 'wsgi_module_name' selected for automatic inline expansion
c:\users\user\desktop\mod_wsgi\mod_wsgi-3.3\new folder\mod_wsgi.c(4046) : warnin
g C4711: function 'newStreamObject' selected for automatic inline expansion
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:mod_wsgi.dll
/dll
/implib:mod_wsgi.lib
"/LIBPATH:c:\Program Files\Microsoft Visual Studio 9.0\VC\lib"
"/LIBPATH:c:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"
/LIBPATH:c:\apache\lib
/LIBPATH:c:\Python32\libs
/OPT:REF
/OPT:ICF=2
/RELEASE
/SUBSYSTEM:WINDOWS
python32.lib
libhttpd.lib
libapr-1.lib
libaprutil-1.lib
/OUT:mod_wsgi.so
mod_wsgi.obj
   Creating library mod_wsgi.lib and object mod_wsgi.exp
mod_wsgi.obj : error LNK2019: unresolved external symbol _PyCObject_FromVoidPtr
referenced in function _Adapter_environ
mod_wsgi.so : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

C:\Users\User\Desktop\mod_wsgi\mod_wsgi-3.3\New folder>

END OUTPUT 

Question on the configuration inside of win32-ap22py32.mk: Should the lib path contain \lib at the end?
My system has apache installed at c:\apache and python in c:\python32.

Thank you. 
To post to this group, send email to mod...@googlegroups.com.
To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.

Michael Benin

unread,
Aug 21, 2011, 4:30:51 PM8/21/11
to mod...@googlegroups.com
http://code.google.com/p/modwsgi/issues/detail?id=205 - Looked at this issue here.

Could it be that I'm using Visual Studio 2010?

Graham Dumpleton

unread,
Aug 21, 2011, 5:26:14 PM8/21/11
to mod...@googlegroups.com
You can't just use mod_wsgi 3.3 tar ball. You need to be using source
code checked out of mod_wsgi source code repository for Python 3.2.

http://code.google.com/p/modwsgi/source/checkout

Graham

Michael Benin

unread,
Aug 21, 2011, 6:05:05 PM8/21/11
to mod...@googlegroups.com
Cloned source with Mercurial:  https://code.google.com/p/modwsgi/
In the folder there is win32-ap22py31.mk

Renamed it: win32-ap22py32.mk

Modified directories to correspond to settings:
--------------------------------------------------------------------
CPPFLAGS = \
 /DWIN32 \
 /DNDEBUG \
 /I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" \
 /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" \
 /I"c:\Program Files\Apache Software Foundation\Apache2.2\include" \
 /I"c:\Python32\include"

CFLAGS = \
 /MD \
 /GF \
 /Gy \
 /O2 \
 /Wall \
 /Zc:wchar_t \
 /Zc:forScope

LDFLAGS = \
 /link \
 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib" \
 "/LIBPATH:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib" \
 "/LIBPATH:c:\Program Files\Apache Software Foundation\Apache2.2\lib" \
 "/LIBPATH:c:\Python32\libs" \
 /OPT:REF \
 /OPT:ICF=2 \
 /RELEASE \
 /SUBSYSTEM:WINDOWS

LDLIBS = \
 python32.lib \
 libhttpd.lib \
 libapr-1.lib \
 libaprutil-1.lib

SRCFILES = wsgi_apache.c wsgi_convert.c wsgi_validate.c

mod_wsgi.so : mod_wsgi.c $(SRCFILES)
cl $(CPPFLAGS) $(CFLAGS) $< $(SRCFILES) /LD $(LDFLAGS) $(LDLIBS) /OUT:$@
        mt -manifest $@.manifest -outputresource:$@;2

clean :
del *.obj *.so *.so.manifest *.lib *.exp

-------------------------------------------------------------------------------------
Command Prompt Output:

Setting environment for using Microsoft Visual Studio 2010 x86 tools.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd C:\Users\User\Desktop\
testing

C:\Users\User\Desktop\testing>nmake -f win32-ap22py32.mk

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : warning U4006: special macro undefined : '$<'
        cl /DWIN32  /DNDEBUG  /I"C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include"  /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
"  /I"c:\Program Files\Apache Software Foundation\Apache2.2\include"  /I"c:\Pyth
on32\include" /MD  /GF  /Gy  /O2  /Wall  /Zc:wchar_t  /Zc:forScope  wsgi_apache.
c wsgi_convert.c wsgi_validate.c /LD /link  "/LIBPATH:C:\Program Files (x86)\Mic
rosoft Visual Studio 10.0\VC\lib"  "/LIBPATH:C:\Program Files (x86)\Microsoft SD
Ks\Windows\v7.0A\Lib"  "/LIBPATH:c:\Program Files\Apache Software Foundation\Apa
che2.2\lib"  "/LIBPATH:c:\Python32\libs"  /OPT:REF  /OPT:ICF=2  /RELEASE  /SUBSY
STEM:WINDOWS python32.lib  libhttpd.lib  libapr-1.lib  libaprutil-1.lib /OUT:mod
_wsgi.so
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

wsgi_apache.c
c:\users\user\desktop\testing\wsgi_apache.h(38) : fatal error C1083: Cannot open
 include file: 'httpd.h': No such file or directory
wsgi_convert.c
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(56) : warnin
g C4820: '_finddata32i64_t' : '4' bytes padding added after data member 'name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(60) : warnin
g C4820: '_finddata64i32_t' : '4' bytes padding added after data member 'attrib'

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(69) : warnin
g C4820: '__finddata64_t' : '4' bytes padding added after data member 'attrib'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(74) : warnin
g C4820: '__finddata64_t' : '4' bytes padding added after data member 'name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(122) : warni
ng C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member 'attri
b'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(127) : warni
ng C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member 'name'

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(131) : warni
ng C4820: '_wfinddata64_t' : '4' bytes padding added after data member 'attrib'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\basetsd.h(114) : war
ning C4668: '__midl' is not defined as a preprocessor macro, replacing with '0'
for '#if/#elif'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\basetsd.h(424) : war
ning C4668: '_WIN32_WINNT' is not defined as a preprocessor macro, replacing wit
h '0' for '#if/#elif'
c:\python32\include\pyport.h(206) : warning C4668: 'SIZEOF_PID_T' is not defined
 as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(162) : war
ning C4211: nonstandard extension used : redefined extern to static
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(91) :
warning C4820: '_stat32' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(107) :
 warning C4820: 'stat' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(123) :
 warning C4820: '_stat32i64' : '2' bytes padding added after data member 'st_gid
'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(124) :
 warning C4820: '_stat32i64' : '4' bytes padding added after data member 'st_rde
v'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(128) :
 warning C4820: '_stat32i64' : '4' bytes padding added after data member 'st_cti
me'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(137) :
 warning C4820: '_stat64i32' : '2' bytes padding added after data member 'st_gid
'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(151) :
 warning C4820: '_stat64' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(152) :
 warning C4820: '_stat64' : '4' bytes padding added after data member 'st_rdev'
c:\python32\include\pytime.h(21) : warning C4820: '<unnamed-tag>' : '4' bytes pa
dding added after data member 'tv_usec'
c:\python32\include\bytesobject.h(41) : warning C4820: '<unnamed-tag>' : '3' byt
es padding added after data member 'ob_sval'
c:\python32\include\longintrepr.h(92) : warning C4820: '_longobject' : '2' bytes
 padding added after data member 'ob_digit'
c:\python32\include\pystate.h(83) : warning C4820: '_ts' : '2' bytes padding add
ed after data member 'recursion_critical'
c:\python32\include\pythonrun.h(172) : warning C4255: '_Py_CheckPython3' : no fu
nction prototype given: converting '()' to '(void)'
c:\Python32\include\node.h(12) : warning C4820: '_node' : '2' bytes padding adde
d after data member 'n_type'
wsgi_convert.c(71) : warning C4127: conditional expression is constant
wsgi_convert.c(113) : warning C4127: conditional expression is constant
wsgi_convert.c(121) : warning C4127: conditional expression is constant
wsgi_convert.c(155) : warning C4127: conditional expression is constant
wsgi_validate.c
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(56) : warnin
g C4820: '_finddata32i64_t' : '4' bytes padding added after data member 'name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(60) : warnin
g C4820: '_finddata64i32_t' : '4' bytes padding added after data member 'attrib'

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(69) : warnin
g C4820: '__finddata64_t' : '4' bytes padding added after data member 'attrib'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(74) : warnin
g C4820: '__finddata64_t' : '4' bytes padding added after data member 'name'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(122) : warni
ng C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member 'attri
b'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(127) : warni
ng C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member 'name'

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\io.h(131) : warni
ng C4820: '_wfinddata64_t' : '4' bytes padding added after data member 'attrib'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\basetsd.h(114) : war
ning C4668: '__midl' is not defined as a preprocessor macro, replacing with '0'
for '#if/#elif'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\basetsd.h(424) : war
ning C4668: '_WIN32_WINNT' is not defined as a preprocessor macro, replacing wit
h '0' for '#if/#elif'
c:\python32\include\pyport.h(206) : warning C4668: 'SIZEOF_PID_T' is not defined
 as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(162) : war
ning C4211: nonstandard extension used : redefined extern to static
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(91) :
warning C4820: '_stat32' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(107) :
 warning C4820: 'stat' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(123) :
 warning C4820: '_stat32i64' : '2' bytes padding added after data member 'st_gid
'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(124) :
 warning C4820: '_stat32i64' : '4' bytes padding added after data member 'st_rde
v'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(128) :
 warning C4820: '_stat32i64' : '4' bytes padding added after data member 'st_cti
me'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(137) :
 warning C4820: '_stat64i32' : '2' bytes padding added after data member 'st_gid
'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(151) :
 warning C4820: '_stat64' : '2' bytes padding added after data member 'st_gid'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys/stat.h(152) :
 warning C4820: '_stat64' : '4' bytes padding added after data member 'st_rdev'
c:\python32\include\pytime.h(21) : warning C4820: '<unnamed-tag>' : '4' bytes pa
dding added after data member 'tv_usec'
c:\python32\include\bytesobject.h(41) : warning C4820: '<unnamed-tag>' : '3' byt
es padding added after data member 'ob_sval'
c:\python32\include\longintrepr.h(92) : warning C4820: '_longobject' : '2' bytes
 padding added after data member 'ob_digit'
c:\python32\include\pystate.h(83) : warning C4820: '_ts' : '2' bytes padding add
ed after data member 'recursion_critical'
c:\python32\include\pythonrun.h(172) : warning C4255: '_Py_CheckPython3' : no fu
nction prototype given: converting '()' to '(void)'
c:\Python32\include\node.h(12) : warning C4820: '_node' : '2' bytes padding adde
d after data member 'n_type'
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

C:\Users\User\Desktop\testing>

---------------------------------------------------------------------------------------------------------------------------------------

Should I try using Visual Studio 2008 instead of 2010?

Graham Dumpleton

unread,
Aug 21, 2011, 6:40:35 PM8/21/11
to mod...@googlegroups.com
I forgot that I haven't yet updated mod_wsgi 4.0 code to build on windows after code reorganization. Sorry you will need to wait.
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 <tel:16.00.30319.01> for 80x86

fanworl

unread,
Sep 10, 2011, 4:09:54 PM9/10/11
to modwsgi
When you plan to make mod_wsgi for Python 3.2 available for windows
compilation?
> >  warning...
>
> продолжение »

Graham Dumpleton

unread,
Sep 10, 2011, 4:26:33 PM9/10/11
to mod...@googlegroups.com
For that particular email you quote, despite what I said at the time,
the issue looks like missing Apache header files. What are the actual
problems that occur when trying to compile it on Windows, besides
needing to create a new makefile? I can't remember if someone
separately has said anything about specific issues. There could well
be because I started splitting the source files apart and haven't even
attempted to recompile it on Windows yet.

So, if someone can provide actual error message output for build where
known that Apache installed properly with header files and they are
being found then may be able to say something a bit more intelligent
about it all. Apologies if this has already been done, I am quite
backlogged in my email right now.

Graham

Reply all
Reply to author
Forward
0 new messages