开发者

Python Linking Problem while running Django on Apache with mod_wsgi: symbol not found __cg_jpeg_resync_to_restart

I get this error when I try to run my django site on apache. The site works on the development server:

ViewDoesNotExist at / 
Could not import myproject.modulename.views. Error was: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_tkinter.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/MAMP/Library/lib/libjpeg.8.dylib

I am not sure how to resolve the issue. Other django sites work on this apache installation. The directory is on the path specified in my apache.conf file (see bottom of the post).

The three files referenced in the error message exist in the locations indicated.

  1. _tkinter.so - /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_tkinter.so

  2. ImageIO - /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

  3. libjpeg.8.dylib - /Applications/MAMP/Library/lib/libjpeg.8.dylib

I am not sure what __cg_jpeg_resync_to_restart is.

Below is the original message I put up when I was trying to figure out what the error message meant. Thanks to sacabuche for pointing me in the right direction.

I am trying to get a Django Site to run on apache. It works on the django development server, but I get this error when I try to run it on apache with mod_wsgi. I know mod_wsgi works because I had a small trial site (that was a scaled down version of this stie) working on my mamp development server. A feat I managed with the help of others via this post: Django/mod_wsgi and PHP as Virtual Hosts on same Apache Server using MAMP

The new site uses a different database and is now at the localhost root, but otherwise is very similar, so this error is baffling me.

Here is the code for my apache conf (note: the php site works, and if I redirect the WSGIDaemonProcess to the old site, it loads without problem):

ServerName localhost UseCanonicalName Off DocumentRoot "/Applications/MAMP/htdocs"

Alias /phpsite /Applications/MAMP/htdocs/phpsite
    <Directory "/Applications/MAMP/htdocs/phpsite">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    WSGIDaemonProcess site1 display-name=%{GROUP}
    WSGIProcessGroup site1
    Alias /media/ /Applications/MAMP/htdocs/media/
    <Directory /Applications/MAMP/htdocs/medi开发者_运维知识库a>
        Options ExecCGI 
        Order deny,allow
        Allow from all
    </Directory>
    WSGIScriptAlias / /Users/sequoia/djangoprojects/myproject/apache/django.wsgi
    <Directory /Users/sequoia/djangoprojects/myproject/apache>
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Thanks.


Well it seems that a symlink is broken, so i looked and i found something in this forum

delete the symlinks "libpng.dylib" and "libjpeg.dylib" in "<installation directory>/lib"

Create new symlinks to the right libs.

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPNG.dylib /Applications/MAMP/Library/lib/libPNG.dylib

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib /Applications/MAMP/Library/lib/libJPEG.dylib

I have no Mac rigth here, but first i would verify that the origin of the symlink exist, i hope this will solve your problem.


Don't you miss the + or - sign in your options statement? Example of statement: Options -Indexes +FollowSymLinks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜