• 1-888-289-2246
  • 24x7x365 Presence

Python scripts on shared Linux servers


Python supports CGI scripts on shared Linux servers.

To run Python scripts you should first make sure of the following steps:

Step 1: Add cgi-bin as cgi-dir in the control panel on the web services section for the domain.
Step 2: Add the .py extension for Python to run against CGI on the web services section for the domain.
Step 3: Place the script inside the cgi-bin directory and make sure that the cgi-bin directory and files in it have permission of 755 to run.
Step 4: Use the shebang at the top => #!/usr/bin/python and then write the script you want and then run it on the browser using the url :-

http://domainname/cgi-bin/python-script.py

That’s it! Your Python script should work fine if you have followed the steps above.

]]>


Leave a Reply

Your email address will not be published. Required fields are marked *