Jump to content

Recommended Posts

Posted

Username: rjsayers, Server: Johnny, Main domain: rjsayers.heliohost.org

 

 

Hi Guys

 

New to Heliohost but it looks really good.

 

I need to run Python on the server side which is why I choose Heliohost but when I run cPanel I see no mention of it. Is it there already and ready to use or does someone have to install/enable something?

 

I also need some Python packages - can I install them by myself or is this undertaken by the administrator?

 

Keep up the good work.

 

Aubrey

Posted

Since you're on Johnny you have three versions of python to choose from

 

/usr/bin/python = 2.6.6

/usr/bin/python2.7 = 2.7.13

/usr/bin/python3.6 = 3.6.1

 

So to get started with python create a file at /home/rjsayers/public_html/cgi-bin/test.py and put these contents

 

#!/usr/bin/python3.6

print("Content-type: text/html\n\n")

print("HelioHost rules!")

 

Next make sure your file is executable by changing the permissions to 755. You can do that through the file manager button in cpanel. Then to view your python script go to rjsayers.heliohost.org/cgi-bin/test.py Let us know if you need help with anything else.

Posted

 

Hi

 

Thanks for the detailed answer. I tried what you suggested and everything looks OK but when I run rjsayers.heliohost.org/cgi-bin/test.py I get a 500 server error. Not sure why.

 

Also I also need some Python packages - can I install them by myself or is this undertaken by the administrator?

 

Cheers

 

________________________________

Posted

Your file has dos line endings. This is usually because you wrote the file on windows and then uploaded it. You can either use an editor that can output linux line endings, or just copy/paste your code into the file manager in cpanel.

Posted

 

Thanks for the fix - works perfectly and I'd never have thought of that. Can you also answer my question regarding Python packages - can I install them by myself or is this undertaken by the administrator?

 

Cheers and very many thanks for your help.

 

________________________________

Guest
This topic is now closed to further replies.
×
×
  • Create New...