agatuz12 Posted October 4, 2018 Share 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 Quote Link to comment Share on other sites More sharing options...
Krydos Posted October 4, 2018 Share 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. Quote Link to comment Share on other sites More sharing options...
agatuz12 Posted October 5, 2018 Author Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.