How to Run Python Scripts on GigaLayer

All our shared servers are deployed with support for python scripts. However, you need to do a few tweaks to have it work for you.

First, you need to setup a handler for your .py script in cPanel; this is not created by default. The handler tells the Apache to pass Python scripts to the Python interpreter on the server to be executed, instead of sending the script to the browser for download. You can define a Python handler in cPanel.

To set handlers in cPanel, look for Apache Handlers on the main cPanel page for the account that needs to run a Python script. Enter cgi-script in the box next to Handler, and enter .cgi .pl .py in the box next to Extension(s). Click Add. The handler will be added and listed as a user-defined handler.

Now, change the permissions on any Python script files in your account to 755 if you have not done so already. The files will need 755 permissions in order for suexec to execute them. The Python script files should now be executed if you call them from a browser.

Should you need any assistance, please contact our Tech Support.

Was this answer helpful?

Also Read

How to Assign/Unassign a MySQL User to a Database

Assign User Privileges to a Database Log into cPanel   Under Databases, click MySQL...

How to Backup MySQL Database in cPanel

You can backup any database on your account using the cPanel backup feature Log into cPanel...

How to Install Wordpress Using Softaculous

Installaing WordPress is very easy. Follow these guide to setup a new wordpress on your website:...

How to Create a Subdomain

Log in to your cPanel Navigate to Subdomains under the Domains tab Enter the...

How to Change cPanel Password in the Core

Often, you may want to change your cPanel password. You can do this from your core panel. To...