mod_wsgi icon indicating copy to clipboard operation
mod_wsgi copied to clipboard

WSGI not accessible from apache Python 3.11 - Help needed

Open kleebauer opened this issue 2 years ago • 2 comments

Who is able to help me?

Thank you in advance

my tries: (venv) C:\xampp\apache\bin>mod_wsgi-express module-config LoadFile "C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0/python311.dll" LoadModule wsgi_module "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/venv/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp311-win_amd64.pyd" WSGIPythonHome "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/venv"

(venv) C:\xampp\apache\bin>httpd -k restart httpd: Syntax error on line 68 of C:/xampp/apache/conf/httpd.conf: Cannot load C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0/python311.dll into server: Zugriff verweigert

(venv) C:\xampp\apache\bin>httpd -k restart httpd: Syntax error on line 69 of C:/xampp/apache/conf/httpd.conf: Cannot load C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/venv/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp311-win_amd64.pyd into server: Das System kann auf die Datei nicht zugreifen.

(venv) C:\xampp\apache\bin>httpd -k restart httpd: Syntax error on line 67 of C:/xampp/apache/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server: Das angegebene Modul wurde nicht gefunden.

my modified httpd.conf:

LoadFile "C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0/python311.dll" LoadModule wsgi_module "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/venv/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp311-win_amd64.pyd" WSGIPythonHome "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/venv"

WSGIScriptAlias / "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/myproject/wsgi.py" WSGIPythonPath "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/myproject"

<Directory "C:/Users/leona/OneDrive/Dokumente/PythonScripts/website/Django/15082023_quantdepot/myproject"> <Files wsgi.py> Require all granted </Files> </Directory>

my enviromental variables:

MOD_WSGI_APACHE_ROOTDIR: C:\xampp\apache\bin

PYTHONPATH C:\Users\leona\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311

kleebauer avatar Aug 15 '23 20:08 kleebauer

Since Apache can't even load the python311.dll file, ensure the following:

  • Both Apache and Python are 64 bit apps. Python appears to be 64 bit, but Apache must also be.
  • Ensure that Python was installed for all users on the system and not just you.

GrahamDumpleton avatar Aug 15 '23 21:08 GrahamDumpleton

@kleebauer .. quicktip: you can use triple back tick or the code-block button .. to nicely format your post, to make it more easily readable.

Like this 

SomeAB avatar Sep 04 '23 13:09 SomeAB