1

I am getting this error:

Server error!
The server encountered an internal error and was unable to complete your request.

Error message:
End of script output before headers: python.py

If you think this is a server error, please contact the webmaster.

Error 500
192.168.64.2
Apache/2.4.41 (Unix) OpenSSL/1.1.1d PHP/7.4.1 mod_perl/2.0.8-dev Perl/v5.16.3

I have done the following:

Added .py to Addhandler in httpd.conf

image

I have done the following:

Added .py to Addhandler in httpd.conf

image

I have also installed pip and pymysql

I am using python 3.8.3

I have also have the permissions set to chmod 755

In the error logs it says:

[Sun Jun 07 01:36:53.823419 2020] [cgi:error] [pid 847] [client 192.168.64.1:51293] AH01215: (2)No such file or directory: exec of '/opt/lampp/htdocs/11-python/python.py' failed: /opt/lampp/htdocs/11-python/python.py
[Sun Jun 07 01:36:53.824918 2020] [cgi:error] [pid 847] [client 192.168.64.1:51293] End of script output before headers: python.py

Heres my code:

#!/usr/local/bin/python3.8
print ('Content-type: text/html\r\n')
print ('\r\n')
print ()
print ('<html>')
print ('<head>')
print ('</head>')
print ('<body>')
print ('Hello Python')
print ('</body>')
print ('</html>')

I am using mac

Pal Dhillon
  • 93
  • 10

0 Answers0