3
問題
使用OS X Yosemite和Python 2.7版,我試圖遵循一個簡單的hello world in Flask with Apache WSGI,但我收到此錯誤執行apachectl -S
時:的Apache 2.4無法加載mod_wsgi.so在約塞米蒂
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
我已經試過
首先,我把文件/usr/libexec/apache2/
與其他mod_*
文件。其次,我試圖按照Graham Dumpleton's answer並驗證以下步驟:
1.您沒有隱藏擴展名並添加了擴展名兩次。
gwg$ file /usr/libexec/apache2/mod_wsgi.so
/usr/libexec/apache2/mod_wsgi.so: Mach-O 64-bit bundle x86_64
2.那mod_wsgi.so文件可讀到任何Apache服務用戶。
我不確定如何做到這一點,但我只是檢查文件的權限對其他.so
文件。例如:
gwg$ ls -l mod_vhost_alias.so
-rwxr-xr-x 1 root wheel 19472 Sep 9 18:11 mod_vhost_alias.so
和
gwg$ ls -l mod_wsgi.so
-rwxr-xr-x 1 root wheel 209564 Dec 4 17:05 mod_wsgi.so
3.你的Apache是32 [64]位。
I'm not sure how to do this.
4.即你的Python是32 [64]位。
>>> import struct
>>> print struct.calcsize("P") * 8
64
5.安裝爲所有用戶你的Python,而不是你安裝它只是用戶。
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.
>>>
問題
任何幫助嗎?提前致謝。