N
N
Nikolai Chuprik2018-11-12 19:14:34
Python
Nikolai Chuprik, 2018-11-12 19:14:34

[not relevant] How to run a Python script on shared hosting?

So far I've only used PHP. I'm trying to get familiar with python for web use. My hoster (apache there) wrote:

Python on our hosting is connected not as an Apache module, but as a separate software.

and gave instructions:
If you already have written CGI scripts, then before copying them to the server, you must do the following: 1. Make sure that the
scripts contain the correct path to the interpreter:
Python: /usr/local/bin/python
set permissions to 755 or -rwxr-xr-x.
Permissions can be changed using the control panel's file manager.

In the file itself I write
test.py:
#!/usr/local/bin/python
import cgi
print("Hello world!")

.htaccess
Options +ExecCGI +FollowSymLinks -Indexes
AddHandler cgi-script .cgi .py

Error 500 arrives on the client. What's wrong. Should I start another python server, if so, how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin ™, 2018-11-13
@Energoblock

Look at the web server logs, everything should be written there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question