0

My CGI scripts (written in python) seem to only display the code. I've followed essentially every tutorial online for CGI and read all the trouble shooting articles but to no avail. I have tried downloading other files to make sure it wasn't my code that was causing the issue).

I've added the handler in apache2.conf and have tried putting files in both /var/www/html and /var/etc/cgi-bin. The files in /var/www/html just display the code and /var/etc/cgi-bin just says File not found. I have also made sure to add executable permissions with chmod 755 <filename>, but that didn't work either. I have also made sure to have appropriate import statements and the #! statement.

Any ideas on how I could fix this?

uvesten
  • 3,365
  • 2
  • 27
  • 40
  • Related: https://stackoverflow.com/questions/10124235/py-file-showing-code-in-browser-instead-of-running – tanderson Mar 09 '19 at 02:51
  • Add code formatting – uvesten Mar 09 '19 at 21:16
  • For people to be able to help you with your question, you should post the contents of your `apache2.conf` and a code example, otherwise it's near impossible to figure out what the problem is. – uvesten Mar 09 '19 at 21:17

0 Answers0