0

I want to run my chatbot in the browser (chatbot code is here)

I have xampp installed on a mac.

When I try to output "Hello World" I get the error:

End of script output before headers: text.py

In the error_log of Xampp is:

(13) Permission denied: exec of '/Applications/XAMPP/xamppfiles/htdocs/chatbot/text.py' failed: /Applications/XAMPP/xamppfiles/htdocs/chatbot/text.py, referer: http: // localhost / chatbot /
[Tue May 14 13:52:48:593860 2019] [cgi: error] [pid 34638] [client :: 1: 56104] End of script output before headers: text.py, referer: http: // localhost / chatbot /

But I have given all the folders the right read and write and also restarted the Xampp. I also changed the httpd.config file so that i can run python code on xampp. (I changed the Handler like this: AddHandler cgi-script .cgi .py)

This ist the code that should run in the browser(simply print hello world)

#!/usr/bin/python3.7
print("Content-type: text/html")
print()

print("Hello, world!")
Community
  • 1
  • 1
Webbuddy
  • 33
  • 1
  • 6

1 Answers1

0

I had several issues like this with XAMPP. Did you try MAMP instead?

Fotios Tragopoulos
  • 449
  • 1
  • 7
  • 24
  • Yes i tried MAMP at first but there was a lot more issues than with XAMPP now (especially when I tried some php code). So I installed XAMPP. – Webbuddy May 14 '19 at 13:06
  • Well, I'm pretty sure there lies your issue. Solutions like XAMPP, WAMP, cPanel etc. will only cause you trouble. – Fotios Tragopoulos May 14 '19 at 13:11
  • I don´t have to use XAMPP, but the problem is it´s a project for my diplom degree and we have to use laravel. And laravel needs XAMPP or something similliar to run. If i could choose I would go with Django or some other framework but it isn´t allowed. Is there any other way than cgi, i could go? I just want to submit a form, get the input in my python file, call my response() method so that i get an answer to my question(form input), and than sent this answer back to the browser. – Webbuddy May 14 '19 at 15:34