У меня есть Apache 2.4.6, python 2.7 на rhel 7
У меня есть моя HTML-версия trial1 как
<form action = "/cgi-bin/upload3.py" method = "post">
First Name: <input type = "text" name = "first_name"><br />
Last Name: <input type = "text" name = "last_name" />
<input type = "submit" value = "Submit" />
</form>
У меня есть скрипт python upload3.py как:
#!/usr/bin/python
import cgi, cgitb
form = cgi.FieldStorage()
first_name = form.getvalue('first_name')
last_name = form.getvalue('last_name')
print "Content-type:text/html"
print "<html>"
print "<head>"
print "<title>Hello - Second CGI Program</title>"
print "</head>"
print "<body>"
print "<h2>Hello %s %s</h2>" % (first_name, last_name)
print "</body>"
print "</html>"
Я сталкиваюсь с внутренней ошибкой 500 сервера при передаче ввода формы в python, также журналы ошибок не обновляются. Раньше, когда он обновлялся, показывалось:
[Mon Jun 04 19:50:23.883970 2018] [cgi:error] [pid 2921] [client 10.19.0.153:63063] AH01215: (2)No such file or directory: exec of '/var/www/cgi-bin/upload3.py' failed, referer: http://10.210.58.218/trial1.html
[Mon Jun 04 19:50:23.884649 2018] [cgi:error] [pid 2921] [client 10.19.0.153:63063] End of script output before headers: upload3.py, referer: http://10.210.58.218/trial1.html