{"id":1536,"date":"2018-09-12T13:17:38","date_gmt":"2018-09-12T13:17:38","guid":{"rendered":"https:\/\/www.xsofthost.com\/help\/?p=1536"},"modified":"2021-03-14T15:28:08","modified_gmt":"2021-03-14T15:28:08","slug":"how-to-install-python-in-my-cpanel-and-add-py-extension","status":"publish","type":"post","link":"https:\/\/www.xsofthost.com\/help\/how-to-install-python-in-my-cpanel-and-add-py-extension\/","title":{"rendered":"How to install python in my cPanel and add py extension"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1536\" class=\"elementor elementor-1536\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-45103f5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"45103f5\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2eab70e\" data-id=\"2eab70e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4be5164 elementor-widget elementor-widget-text-editor\" data-id=\"4be5164\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Python normally installed on all cPanel hosting server because most of Centos\/red hat update system use it.<\/p>\n<p>For python apache python extension ,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.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1abe71f elementor-widget elementor-widget-heading\" data-id=\"1abe71f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What is Python:<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b55a4b elementor-widget elementor-widget-text-editor\" data-id=\"0b55a4b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together..\u00a0<\/p>\n<p>Python&#8217;s design philosophy emphasizes code readability with its notable use of significant indentation.\u00a0<\/p>\n<p>Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5587b0b elementor-widget elementor-widget-heading\" data-id=\"5587b0b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">How to add python apache python extension Handler from your cPanel account\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-502f040 elementor-widget elementor-widget-text-editor\" data-id=\"502f040\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul>\n<li>Login to your <a href=\"https:\/\/www.xsofthost.com\/help\/tag\/cpanel\/\">cPanel<\/a> account<\/li>\n<li>From Advance group click Apache Handlers link.<\/li>\n<li>On create Apache Handler add the Handler\u00a0<strong>cgi-script\u00a0<\/strong>,and in extensions add .py extension the click Add ,This will create user defined Apache Handlers.<\/li>\n<li>Then ,change the permissions for any python file to\u00a0<strong>755\u00a0<\/strong>,this permissions need it in order for suexec to execute the files.<\/li>\n<li>In yor python .py files you can use the following\u00a0#!\/usr\/bin\/python<\/li>\n<\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a82b2b0 elementor-widget elementor-widget-code-highlight\" data-id=\"a82b2b0\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-solarizedlight copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>#!\/usr\/bin\/python<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Python normally installed on all cPanel hosting server because most of Centos\/red hat update system use it. For python apache python extension ,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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":301,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[194],"tags":[32,169,4,178,195,74],"_links":{"self":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/1536"}],"collection":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/comments?post=1536"}],"version-history":[{"count":22,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/1536\/revisions"}],"predecessor-version":[{"id":1835,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/1536\/revisions\/1835"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media\/301"}],"wp:attachment":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media?parent=1536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/categories?post=1536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/tags?post=1536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}