Web Services AH00526在Ubuntu上使用Apache运行python时出错

ztmd8pv5  于 2022-12-13  发布在  Apache
关注(0)|答案(1)|浏览(252)

我试图运行python,使用Xampp-8.1.12和Apache 2.4,因为我的项目使用python脚本。所以我添加了以下行到/opt/lampp/apache2/conf/httpd.conf

AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict

下面的Web教程。但当我添加以上内容并重新启动Apache服务器时,它没有启动,并出现以下错误:

AH00526: Syntax error on line 12 of /opt/lampp/apache2/conf/httpd.conf:
Invalid command 'ScriptInterpreterSource', perhaps misspelled or defined by a module not included in the server configuration

我已经安装了python3和python 2,我在文件中提到,我想运行,该文件将与python3一起运行。

toiithl6

toiithl61#

你必须从你的httpd.conf文件中删除ScriptInterpreterSource,因为Apache无法识别它,你会得到这个错误。尝试使用AddHandler,这样Apache会在你的.py文件上运行Python解释器。

相关问题