Jump to content

How to run a python script


agatuz12

Recommended Posts

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: ricky

User: agatuz12

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by agatuz12
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...