Ich habe versucht herauszufinden, was dieses Problem seit Stunden verursacht, aber ohne Glück.Apache/mod_wsgi/django/arch linux Probleme seit 64-Bit-Upgrade, obwohl in der Lage, alle Bibliotheken zu importieren
Da mein Bogen Linux-Installation auf 64-Bit-Migration Ich habe meine django Standorten arbeiten, nicht mit Fehler gefunden 500. Ich bin mit python2, die 64-Bit:
>>> import struct
>>> print struct.calcsize("P") * 8
64
Und ich auch haben 64 Bit mod_wsgi2: https://www.archlinux.org/packages/community/x86_64/mod_wsgi2/
Hier ist ein Beispiel log:
[Mon Feb 20 21:42:40.312829 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] mod_wsgi (pid=19537): Target WSGI script '/home/james/sites/dse/django.wsgi' cannot be loaded as Python module.
[Mon Feb 20 21:42:40.312872 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] mod_wsgi (pid=19537): Exception occurred processing WSGI script '/home/james/sites/dse/django.wsgi'.
[Mon Feb 20 21:42:40.312916 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] Traceback (most recent call last):
[Mon Feb 20 21:42:40.312953 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] File "/home/james/sites/dse/django.wsgi", line 12, in <module>
[Mon Feb 20 21:42:40.312997 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] from django.core.wsgi import get_wsgi_application
[Mon Feb 20 21:42:40.313006 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] File "/usr/lib/python2.7/site-packages/django/__init__.py", line 3, in <module>
[Mon Feb 20 21:42:40.313056 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] from django.utils.version import get_version
[Mon Feb 20 21:42:40.313066 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] File "/usr/lib/python2.7/site-packages/django/utils/version.py", line 3, in <module>
[Mon Feb 20 21:42:40.313078 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] import datetime
[Mon Feb 20 21:42:40.313103 2017] [wsgi:error] [pid 19537] [client 146.179.195.99:62898] ImportError: /usr/lib/python2.7/lib-dynload/datetime.so: wrong ELF class: ELFCLASS64
[Mon Feb 20 21:42:40.313185 2017] [access_compat:error] [pid 19537] [client 146.179.195.99:62898] AH01797: client denied by server configuration: /usr/share/httpd/error/HTTP_INTERNAL_SERVER_ERROR.html.var
Also habe ich versucht, manuell, all diese Dinge zu importieren, um zu sehen, ob ich eine Fehlermeldung anzeigt, nee:
[[email protected] ~]$ python2
Python 2.7.13 (default, Dec 21 2016, 07:16:46)
[GCC 6.2.1 20160830] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> import django
>>> from django.core.wsgi import get_wsgi_application
>>> from django.utils.version import get_version
Ich habe überprüft, dass die ich habe: LoadModule- wsgi_module modules/mod_wsgi.so
In meinem httpd.conf, und der Inhalt der/home/james/sites/dse/django .wsgi Datei in der Fehler verwickelt nicht in etwa 3 Jahren verändert und sind wie folgt (!):
[[email protected] dse]$ cat django.wsgi
import os
import sys
sys.path.append('/home/james/sites/dse/django_dse')
sys.path.append('/home/james/sites/dse')
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_dse.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Also ich bin nicht sicher, was zu tun ist. Ich meine, es klingt wie ein 32/64 Bit Kompatibilitätsproblem mit dem Fehler ImportError: /usr/lib/python2.7/lib-dynload/datetime.so: falsche ELF-Klasse: ELFCLASS64 - aber ich kann nicht herausfinden, was es verursacht.
Irgendwelche Ideen?
Wenn Sie eine virtuelle Python-Umgebung verwenden, haben Sie sie neu erstellt. –