Python normally installed on all cPanel hosting server because most of centos/red hat update system use it.
you only needs to activate the python handler for your apache to allow the apache server serve the py file and execute it instead of send the script to the browser as downloadable file.
How to add python on apache Handler from your cPanel account
- Login to your cPanel account
- From Advance group click Apache Handlers link.
- On create Apache Handler add the Handler cgi-script ,and in extensions add .py extension the click Add ,This will create user defined Apache Handlers.
- Then ,change the permissions for any python file to 755 ,this permissions need it in order for suexec to execute the files.
- In yor python .py files you can use the following #!/usr/bin/python
4,584 total views, 7 views today