apache+MrDoc启动报错

这篇博客记录了在Windows环境下配置Apache服务器时遇到的问题,具体表现为启动Apache时出现Python环境配置错误,找不到'encodings'模块。解决方案是设置环境变量PYTHONHOME和PYTHONPATH,重启Apache服务。
摘要由CSDN通过智能技术生成

报错内容如下:

[Wed Jun 01 10:24:14.478004 2022] [mpm_winnt:notice] [pid 40296:tid 348] AH00455: Apache/2.4.53 (Win64) mod_wsgi/4.9.1 Python/3.10 configured -- resuming normal operations
[Wed Jun 01 10:24:14.479003 2022] [mpm_winnt:notice] [pid 40296:tid 348] AH00456: Apache Lounge VS16 Server built: May  4 2022 10:41:15
[Wed Jun 01 10:24:14.479003 2022] [core:notice] [pid 40296:tid 348] AH00094: Command line: 'G:\\MrDoc\\Apache24\\bin\\httpd.exe -d G:/MrDoc/Apache24'
[Wed Jun 01 10:24:14.487004 2022] [mpm_winnt:notice] [pid 40296:tid 348] AH00418: Parent: Created child process 42272
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'G:\\MrDoc\\Apache24\\bin\\httpd.exe'
  sys.base_prefix = 'C:\\Python310'
  sys.base_exec_prefix = 'C:\\Python310'
  sys.platlibdir = 'lib'
  sys.executable = 'G:\\MrDoc\\Apache24\\bin\\httpd.exe'
  sys.prefix = 'C:\\Python310'
  sys.exec_prefix = 'C:\\Python310'
  sys.path = [
    'C:\\Python310\\python310.zip',
    '.\\DLLs',
    '.\\lib',
    'G:\\MrDoc\\Apache24\\bin',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00009160 (most recent call first):
  <no Python frame>

解决办法:

在环境变量中设置:PYTHONHOME和PYTHONPATH,重启apache即可。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值