[mod_python] Trouble on OSX - Leopard

Ben Mitchell ben at mitchellfamily.com
Tue Oct 30 01:43:50 EDT 2007


Hrmmm...

Not working.  I had to add the same flags to both CFLAGS and LDFLAGS  
to get it to make a 64-bit version (not sure that was the right  
move).  But now I get this:

sh-3.2# file /usr/libexec/apache2/mod_python.so
/usr/libexec/apache2/mod_python.so: Mach-O 64-bit bundle x86_64
sh-3.2# apachectl configtest
httpd: Syntax error on line 116 of /private/etc/apache2/httpd.conf:  
Can't locate API module structure `python_module' in file /usr/libexec/ 
apache2/mod_python.so: dlsym(0x1002179c0, python_module): symbol not  
found

Got something similar for mod_wsgi:

sh-3.2# apachectl configtest
httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf:  
Cannot load /usr/libexec/apache2/mod_wsgi.so into server: dlopen(/usr/ 
libexec/apache2/mod_wsgi.so, 10): Symbol not found: _PyExc_RuntimeError 
\n  Referenced from: /usr/libexec/apache2/mod_wsgi.so\n  Expected in:  
dynamic lookup\n


Anyway, I don't want to consume your evening with this :-)  I'll keep  
plugging away at it.  I really appreciate the help.  I think I'm at  
least on the right track now.

-Ben

On Oct 29, 2007, at 10:23 PM, Graham Dumpleton wrote:

Try editing Makefile and adding option to CFLAGS:

  CFLAGS = -Wc,-m64

At least I think that -m64 is the option. The -Wc, bit is to get it
past apxs/libtool build tool.

Graham

On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
> You're on the right track, but off by a hair ;-)
>
> Turns out httpd is an Intel (64 bit) process
>
> Sooo...  I need to figure out how to get a 64-bit version of the .so
> built, when it's building only the 32-bit version by default.
>
> Any thoughts on that?
>
> And thanks.  I _never_ would've figured this one out on my own.
>
> -Ben
>
> On Oct 29, 2007, at 10:05 PM, Graham Dumpleton wrote:
>
> Okay, might now what the issue is now.
>
> What may be happening is that Apache server is running up in Rosetta
> (ie., PPC), and because the mod_wsgi/mod_python .so files are Intel
> only it isn't working.
>
> First step is to determine what Apache is running as. Think you can do
> this by running 'Activity Viewer' or whatever they now call it. Ensure
> that 'Kind' column is viewable and see what is against httpd
> processes. Will be PowerPC or Intel. If it shows PowerPC, that will be
> the problem.
>
> To fix I think you run Finder, select Go->Go To Folder and enter
> '/usr/sbin'. Then find 'httpd' and go File->GetInfo. From memory in
> there somewhere is a way of marking the process to run as Intel rather
> than PowerPC.
>
> The question is that if this is necessary, why it is running as
> PowerPC by default.
>
> Graham
>
> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>> Sorry.  Missed what you were asking for.  Looks like most of them
>> have all
>> the architectures, but the Mach-O bundle i386 seems to be the same
>> for the
>> wsgi one and the others.
>>
>>
>>
>> [Macintosh:~/Documents/Development] benha% file
>> /usr/libexec/apache2/*.so
>> /usr/libexec/apache2/libphp5.so:             Mach-O
>> universal binary with 4 architectures
>> /usr/libexec/apache2/libphp5.so (for architecture ppc7400): Mach-O
>> bundle
>> ppc
>> /usr/libexec/apache2/libphp5.so (for architecture ppc64): Mach-O 64-
>> bit
>> bundle ppc64
>> /usr/libexec/apache2/libphp5.so (for architecture i386): Mach-O
>> bundle i386
>> /usr/libexec/apache2/libphp5.so (for architecture x86_64): Mach-O 64-
>> bit
>> bundle x86_64
>> /usr/libexec/apache2/mod_actions.so:         Mach-O
>> universal binary with 4 architectures
>> /usr/libexec/apache2/mod_actions.so (for architecture
>> ppc7400): Mach-O bundle ppc
>> /usr/libexec/apache2/mod_actions.so (for architecture
>> ppc64): Mach-O 64-bit bundle ppc64
>> /usr/libexec/apache2/mod_actions.so (for architecture
>> i386): Mach-O bundle i386
>> /usr/libexec/apache2/mod_actions.so (for architecture
>> x86_64): Mach-O 64-bit bundle x86_64
>> ...
>>
>>
>>
>>
>>
>>
>> On Oct 29, 2007, at 9:47 PM, Graham Dumpleton wrote:
>> Was there no other .so files besides mod_wsgi.so in:
>>
>> /usr/libexec/apache2
>>
>> Was wanting to see what 'file' yielded on other .so files in that
>> directory.
>>
>> if there is no other .so files, would suggest that they are static
>> linking core Apache modules, which they haven't done in the past.
>>
>> Anyway, I will bring it all up on Apache modules-dev list in case
>> others have heard about such issues.
>>
>> Graham
>>
>> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>>
>> Looks ok to me, though we're way out of my depth at this point :-)
>>
>>
>>
>> [Macintosh:~/Documents/Development] benha% file
>> /usr/sbin/httpd
>> /usr/sbin/httpd: Mach-O universal binary with 4 architectures
>> /usr/sbin/httpd (for architecture ppc7400): Mach-O executable ppc
>> /usr/sbin/httpd (for architecture ppc64): Mach-O 64-bit executable
>> ppc64
>> /usr/sbin/httpd (for architecture i386): Mach-O executable i386
>> /usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable
>> x86_64
>> [Macintosh:~/Documents/Development] benha% file
>> /usr/libexec/apache2/mod_wsgi.so
>> /usr/libexec/apache2/mod_wsgi.so: Mach-O bundle i386
>> [Macintosh:~/Documents/Development] benha%
>>
>>
>>
>>
>> On Oct 29, 2007, at 9:35 PM, Graham Dumpleton wrote:
>> One more and then I will have exhausted my ideas and may have to
>> research elsewhere.
>>
>> file /usr/sbin/httpd
>>
>> Change path if this isn't what Apache server executable is called.
>>
>> file /usr/libexec/apache2/*.so
>>
>> This is to see what other Apache and other modules are compiled as.
>> Ie., Intel only or dual architecture etc.
>>
>> Graham
>>
>> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>>
>> [Macintosh:local/src/PyGreSQL-3.8.1] benha% otool -L
>> /usr/libexec/apache2/mod_wsgi.so
>> /usr/libexec/apache2/mod_wsgi.so:
>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>> version
>> 111.0.0)
>> /Library/Frameworks/Python.framework/Versions/2.5/Python
>> (compatibility version 2.5.0, current version 2.5.0)
>> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
>> version
>> 1.0.0)
>> [Macintosh:local/src/PyGreSQL-3.8.1] benha%
>>
>>
>>
>>
>> On Oct 29, 2007, at 9:18 PM, Graham Dumpleton wrote:
>> How about:
>>
>> otool -L /usr/libexec/apache2/mod_wsgi.so
>>
>> Should refer to standard Python framework.
>>
>> Graham
>>
>> On 30/10/2007, Ben Mitchell <ben at mitchellfamily.com> wrote:
>>
>> I started off yesterday doing an "Upgrade."  But I found enough
>> weirdness
>> that I did an "Archive and Install" tonight.  It's an intel MacBook
>> Pro.
>> ...
>>
>> [Message clipped]
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20071029/4ab3bb78/attachment.html


More information about the Mod_python mailing list