Я пытаюсь выполнить простой скрипт python на моем localhost.
Сценарий помещается в htdocs-> test.py
Скрипт:
#!C:\Users\First Last\AppData\Local\Programs\Python\Python37-32\python\python.exe
print("Single Quotes")
Перед удалением http:\localhost\test.py в браузере я запустил сервер Apache. Также добавляется ниже строк в конце файла: httpd.conf:
AddHandler cgi-script.py ScriptInterpreterSource Registry-Strict
Но все же, когда я нажимаю http:\localhost\test.py в браузере, он показывает ошибку:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.7
Я прочитал много статей/сообщений в Интернете, чтобы решить эту проблему, но не могу ее решить. Пожалуйста помоги.
Вам также нужно вывести заголовки HTTP-ответов.
Например:
#!C:\Users\First Last\AppData\Local\Programs\Python\Python37-32\python\python.exe
print("Content-type: text/plain\n")
print("Single Quotes")