Home > OS >  AH00526 Error while running python using Apache on Ubuntu
AH00526 Error while running python using Apache on Ubuntu

Time:12-09

I was trying to run python, using Xampp-8.1.12 with Apache 2.4, since my project use python script. So I added the following lines to /opt/lampp/apache2/conf/httpd.conf :

AddHandler cgi-script .py
ScriptInterpreterSource Registry-Strict

following the web tutorials. But as I added the above and restarted Apache server it is not starting with following error:

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

I have python3 and python 2 both installed and I have mentioned in the file, I would like to run, that the file is to be run with python3.

Image description of the error

CodePudding user response:

You have to remove the ScriptInterpreterSource from your httpd.conf file, because it is not recognized by Apache and you get that error. Try using AddHandler so Apache runs the Python interpreter on your .py files.

  • Related