agatuz12 Posted October 4, 2018 Posted October 4, 2018 Hello, I need help to run a simple python script on my heliohost server.I looked an old topic to find some information, but still can't run no scripts at all.I tried using the cgi and set permissions to 755, but didn't work.Here is the code I found #!/usr/bin/python3.6 print "Content-type: text/html\n\n" print "How to run Python scripts in cPanel" This dosen't work, when I try to open http://agatuz12.heliohost.org/cgi-bin/test.py I get a 500 Internal Server Error.Hope someone can help me to find a solution. Server: rickyUser: agatuz12
Krydos Posted October 4, 2018 Posted October 4, 2018 Your file has dos line endings, which usually means you created the file in windows and then uploaded it. You need to use an editor that understands and can write linux line endings before you upload it, or more easily just create the file through cpanel and copy/paste the code in.
agatuz12 Posted October 5, 2018 Author Posted October 5, 2018 (edited) Thank you for the help, now I created the file, 'test.py', with the cpanel, and I wrote the code with the editor, but this still dosen't work. EDIT:Ok now it works, but I chnged the line "#!/usr/bin/python 3.6" in "#!/usr/bin/python" Edited October 5, 2018 by agatuz12
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now