Problem
Using OS X Yosemite and Python 2.7, I am trying to follow a simple hello world in Flask with Apache WSGI but am receiving this error when executing apachectl -S
:
httpd: Syntax error on line 171 of /private/etc/apache2/httpd.conf: Cannot load libexec/mod_wsgi.so into server: dlopen(/usr/libexec/mod_wsgi.so, 10): image not found
What I've tried
First, I placed the file in /usr/libexec/apache2/
with the other mod_*
files. Second, I tried to follow Graham Dumpleton's answer and verify the following steps:
1. That you don't have extensions hidden and have added the extension twice.
gwg$ file /usr/libexec/apache2/mod_wsgi.so
/usr/libexec/apache2/mod_wsgi.so: Mach-O 64-bit bundle x86_64
2. That the mod_wsgi.so file is readable to whatever Apache service user is.
I'm not sure exactly how to do this, but I just checked the file's permissions against other .so
files. For example:
gwg$ ls -l mod_vhost_alias.so
-rwxr-xr-x 1 root wheel 19472 Sep 9 18:11 mod_vhost_alias.so
and
gwg$ ls -l mod_wsgi.so
-rwxr-xr-x 1 root wheel 209564 Dec 4 17:05 mod_wsgi.so
3. That your Apache is 32 [64] bit.
I'm not sure how to do this.
4. That your Python is 32 [64] bit.
Per this SO answer:
>>> import struct
>>> print struct.calcsize("P") * 8
64
5. That your Python is installed for all users and not just user you installed it as.
gwg$ sudo su -
root# python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Question
Any help? Thanks in advance.