我试图运行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一起运行。
1条答案
按热度按时间toiithl61#
你必须从你的
httpd.conf
文件中删除ScriptInterpreterSource
,因为Apache无法识别它,你会得到这个错误。尝试使用AddHandler
,这样Apache会在你的.py
文件上运行Python解释器。