M
M
Max Payne2017-06-09 12:57:55
Python
Max Payne, 2017-06-09 12:57:55

Why does the script not work when accessed from apache?

When I try to run the file from the Apache side, I see the following error in the logs:

[Fri Jun 09 12:46:49.231510 2017] [cgi:error] [pid 2232] [client 178.129.221.81:31492] AH01215: (2)No such file or directory: exec of '/var/www/html/callback.py' failed: /var/www/html/callback.py
[Fri Jun 09 12:46:49.233515 2017] [cgi:error] [pid 2232] [client 178.129.221.81:31492] End of script output before headers: callback.py

However, when run from the console, everything is fine:
[email protected]:~$ python /var/www/html/callback.py
Content-Type: text/html

somedata

What is the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2017-06-11
@dimonchik2013

call exec directly to Python and pass the filename as a parameter, to Python - the full path

V
Vitaliy K, 2018-06-15
@revenger

Check line breaks, should be Unix, and you most likely have windows. This can be done in Sublime.
www.khtulhu.org.ua/web-programmirovanie/823-oshibk...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question