{"id":138,"date":"2006-11-27T17:15:01","date_gmt":"2006-11-27T17:15:01","guid":{"rendered":"https:\/\/bodhost.com\/kb\/\/web-hosting\/?p=138"},"modified":"2026-02-26T14:04:59","modified_gmt":"2026-02-26T14:04:59","slug":"enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/","title":{"rendered":"Enable Cgi-bin for any Folder"},"content":{"rendered":"<p><strong><\/strong><\/p>\r\n<div>\r\n<p data-start=\"320\" data-end=\"649\">CGI (Common Gateway Interface) scripts allow you to run programs or scripts (such as .cgi, .pl, or .py) on your web server to generate dynamic content. By default, many servers only allow CGI scripts in the cgi-bin directory, but you may want to enable CGI for a specific folder within your hosting account.<\/p>\r\n<p data-start=\"651\" data-end=\"735\">This guide will show you how to enable CGI in any folder using a .htaccess file.<\/p>\r\n<h3 data-start=\"742\" data-end=\"764\">What is CGI-Bin?<\/h3>\r\n<ul data-start=\"765\" data-end=\"1070\">\r\n<li data-start=\"765\" data-end=\"849\">\r\n<p data-start=\"767\" data-end=\"849\">cgi-bin is a directory where servers typically store executable CGI scripts.<\/p>\r\n<\/li>\r\n<li data-start=\"850\" data-end=\"963\">\r\n<p data-start=\"852\" data-end=\"963\">These scripts can perform tasks like form processing, database connections, and generating dynamic web pages.<\/p>\r\n<\/li>\r\n<li data-start=\"964\" data-end=\"1070\">\r\n<p data-start=\"966\" data-end=\"1070\">Enabling CGI for other folders gives developers more flexibility in organizing their web applications.<\/p>\r\n<\/li>\r\n<\/ul>\r\n<h3>Steps to Enable CGI-Bin for Any Folder<\/h3>\r\n<p><strong>1. Create a .htaccess File<\/strong><\/p>\r\n<p>In the folder where you want to enable CGI, create a new file named: &#8220;<em>.htaccess<\/em>&#8220;<\/p>\r\n<p><strong>2. Add Execution Permission<\/strong><\/p>\r\n<p>Insert the following directive in the .htaccess file:<\/p>\r\n<p>&#8220;<em>Options +ExecCGI&#8221;<\/em><\/p>\r\n<p><strong>3. Define CGI Handlers<\/strong><\/p>\r\n<p>Add the handlers for CGI scripts so that the server knows how to process them:<\/p>\r\n<p><em>&#8220;AddHandler cgi-script .cgi .pl&#8221;<\/em><\/p>\r\n<p><strong>4. (Optional) Update Apache Config<\/strong><\/p>\r\n<p>If your setup requires additional configuration, you can update the Apache config file:<\/p>\r\n<p>Include \/etc\/httpd\/conf\/site#\/enable-cgi<br \/>Options +ExecCGI<\/p>\r\n<p><strong>5. Restart Apache<\/strong><\/p>\r\n<p>For changes to take effect, restart the Apache service:<\/p>\r\n<p>systemctl restart httpd<\/p>\r\n<p>By creating a .htaccess file and adding the right directives, you can enable CGI-bin functionality for any folder on your server. This allows more flexibility in running scripts and building dynamic web applications. Always remember to set correct file permissions and follow security best practices while working with CGI.<\/p>\r\n<\/div>\r\n<p><strong><\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>CGI (Common Gateway Interface) scripts allow you to run programs or scripts (such as .cgi, .pl, or .py) on your web server to generate dynamic content. By default, many servers&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[666],"tags":[1049,1187,1188],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-general","tag-cgi-bin","tag-enable-cgi-bin-for-any-folder","tag-folder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to enable Cgi-bin for any folder?<\/title>\n<meta name=\"description\" content=\"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to enable Cgi-bin for any folder?\" \/>\n<meta property=\"og:description\" content=\"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2006-11-27T17:15:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:04:59+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\"},\"headline\":\"Enable Cgi-bin for any Folder\",\"datePublished\":\"2006-11-27T17:15:01+00:00\",\"dateModified\":\"2026-02-26T14:04:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/\"},\"wordCount\":265,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"CGI-Bin\",\"Enable Cgi-bin for any Folder\",\"Folder\"],\"articleSection\":[\"General Discussion\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/\",\"name\":\"How to enable Cgi-bin for any folder?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2006-11-27T17:15:01+00:00\",\"dateModified\":\"2026-02-26T14:04:59+00:00\",\"description\":\"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"General Discussion\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/general\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enable Cgi-bin for any Folder\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to enable Cgi-bin for any folder?","description":"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/","og_locale":"en_US","og_type":"article","og_title":"How to enable Cgi-bin for any folder?","og_description":"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com","og_url":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2006-11-27T17:15:01+00:00","article_modified_time":"2026-02-26T14:04:59+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/"},"author":{"name":"admin","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9"},"headline":"Enable Cgi-bin for any Folder","datePublished":"2006-11-27T17:15:01+00:00","dateModified":"2026-02-26T14:04:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/"},"wordCount":265,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["CGI-Bin","Enable Cgi-bin for any Folder","Folder"],"articleSection":["General Discussion"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/","url":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/","name":"How to enable Cgi-bin for any folder?","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2006-11-27T17:15:01+00:00","dateModified":"2026-02-26T14:04:59+00:00","description":"In this article you will learn about How to enable Cgi-bin for any folder? For more details visit bodhost.com","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/enable-cgi-bin-for-any-folder-enable-cgi-bin-for-any-folder\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"General Discussion","item":"https:\/\/www.bodhost.com\/kb\/category\/general\/"},{"@type":"ListItem","position":2,"name":"Enable Cgi-bin for any Folder"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.bodhost.com\/kb\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":7,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":14604,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/138\/revisions\/14604"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}