0

There are a lot of similar questions noting that they could not get Apache (2.4) started due to improperly created "PYTHONHOME" and "PYTHONPATH" variables.

I have installed mod_wsgi, I am using python 3.8.0, I am on Windows 10 x64 and have x64 bit installations of all my modules. When I start Apache, though, (httpd -k start, restart) the service does not start. I tried manually doing the same in the services tab of Task Manager, it also immediately stopped after I tried to run Apache.

Looking in the logs, it seems my issue is also related to the aforementioned variables, however in other peoples' cases, they were advised to remove the variables whereas it seems mine are not set to anything in the first place. I had read that setting these variables inadvertently masks system variables, but that does not seem to be the case for me.

The most explicit error in the logs seemed to be of the "encodings" module not being found. I have attached a screenshot of the log below.

Can anyone help me get Apache24 running?

P.S. I am using Apache Haus Distribution, I believe the name of the installation I have is.

Error.log Report

  • Try the suggested answer [here](https://stackoverflow.com/questions/38132755/importerror-no-module-named-encodings) – mnikley Oct 28 '21 at 11:22

1 Answers1

0

Yes, this error is reported when PYTHONHOME does not have a valid Python installation.

This answer may help: https://stackoverflow.com/a/69949005/2850706

  • I've both unset my PYTHONPATH and PYTHONHOME as well as try setting the PYTHONPATH to /foo/bar/python.exe and PYTHONHOME to /foo/bar. In every situation I get the same encodings issue. I have fixed this before but it's been so long I can't remember what to do now. It doesn't seem to be related to the normal PYTHONHOME/PYTHONPATH issue. – oishi_yamamoto Nov 30 '21 at 16:24
  • If running Apache on Windows, try to NOT run it as a service. Windows services would not pick up env var changes made after startup. – AgileTroops.com Dec 01 '21 at 17:26
  • Running it by using the command (httpd) instead of (httpd -k start/stop/restart) _does_ work, but I would like to know why this is. I would also like to know if I can run it regularly (httpd -k start) as when I run it using the command you've suggested (NOT a service) I have to leave the terminal open. Thanks – oishi_yamamoto Dec 14 '21 at 20:15