{"id":25895,"date":"2020-12-21T02:45:13","date_gmt":"2020-12-20T18:45:13","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=25895"},"modified":"2022-09-08T21:38:43","modified_gmt":"2022-09-08T13:38:43","slug":"how-can-i-run-perl-or-cgi-scripts","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-can-i-run-perl-or-cgi-scripts","title":{"rendered":"How can I run Perl or CGI scripts?"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"25895\" class=\"elementor elementor-25895\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2b1391d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2b1391d\" 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-b2cf720\" data-id=\"b2cf720\" 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-0fa71ba elementor-widget elementor-widget-heading\" data-id=\"0fa71ba\" 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 can I run Perl or CGI scripts on Windows servers? <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-49533cc elementor-widget elementor-widget-text-editor\" data-id=\"49533cc\" 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<div class=\"mkb-article-text mkb-clearfix\"><p>You can upload the scripts to \/cgi-bin folder.<br \/>Here is the path for the perl.exe c:perlbinperl.exe.<\/p><p>Therefore, to run the CGI scripts, please rename all the files to extension .pl . You may relocate all the CGI scripts into the scripts folder.<\/p><p>Please remember to CHMOD them.<br \/>Normally you need to CHMOD 755 which you can do via FTP software.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-48532dc elementor-widget elementor-widget-heading\" data-id=\"48532dc\" 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 a CGI script?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8f45180 elementor-widget elementor-widget-text-editor\" data-id=\"8f45180\" 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<div class=\"mkb-article-text mkb-clearfix\"><p>A CGI script is a small program, or script, that runs on the Web server. It usually produces some sort of dynamically-generated Web page, such as a guestbook page or some information pulled from a database.<\/p><p><dfn>CGI<\/dfn>\u00a0stands for\u00a0<b>C<\/b>ommon\u00a0<b>G<\/b>ateway\u00a0<b>I<\/b>nterface. It\u2019s simply a mechanism to allow Web servers to run external programs or scripts when requested by a Web browser.<\/p><p>You can write CGI programs or scripts in any programming language you like, as long as the end result is something the server can run. However, CGI scripts are usually written in Perl.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-77f612f elementor-widget elementor-widget-heading\" data-id=\"77f612f\" 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 Perl?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dcd5c0e elementor-widget elementor-widget-text-editor\" data-id=\"dcd5c0e\" 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<div class=\"mkb-article-text mkb-clearfix\"><p><a href=\"https:\/\/www.perl.org\/\" rel=\"noopener\">Perl<\/a> is a powerful and flexible scripting language. Also, Perl is an interpreted language. This means that you can make changes to a Perl script and see the results immediately (unlike programming in C, where you have to recompile the program each time). This makes Perl highly suitable for CGI scripting.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-97b9e8d elementor-widget elementor-widget-heading\" data-id=\"97b9e8d\" 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 does a CGI script actually look like?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8bde5b1 elementor-widget elementor-widget-text-editor\" data-id=\"8bde5b1\" 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<div class=\"mkb-article-text mkb-clearfix\"><p>Here is a very simple CGI script written in Perl. Don\u2019t worry if you don\u2019t understand it at this point. We\u2019ll explain this script in more detail in a later tutorial!<\/p><pre class=\"code\"><code>\n#!\/usr\/bin\/perl\n\nprint \"Content-type: text\/html\\n\\n\";\n\nprint &lt;&lt;END_HTML;\n\nHello, World!\n\nEND_HTML\n<\/code><\/pre><p>This CGI script simply displays a Web page containing the text \u201cHello, World!\u201d.<\/p><p>A CGI script is a file, just like a Web page, or a GIF image. The main difference is that CGI scripts are actually run by the Web server, whereas images and Web pages are simply displayed.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9df28ed elementor-widget elementor-widget-heading\" data-id=\"9df28ed\" 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 do I run a CGI script on my Web server?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9e093d7 elementor-widget elementor-widget-text-editor\" data-id=\"9e093d7\" 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<div class=\"mkb-article-text mkb-clearfix\"><p>A CGI script is a file, just like a Web page, or a GIF image. The main difference is that CGI scripts are actually run by the Web server, whereas images and Web pages are simply displayed.<\/p><p>Usually, you will need to upload your CGI scripts to your Web server, just like you upload your Web pages and images (often using FTP). On most Web servers you will need to upload it to the\u00a0<code class=\"filename\">cgi-bin<\/code>\u00a0folder on your site.<\/p><p>In other words, once you\u2019ve uploaded the script, you usually need to set its permissions.\u00a0<\/p><\/div>\t\t\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>How can I run Perl or CGI scripts on Windows servers? You can upload the scripts to \/cgi-bin folder.Here is the path for the perl.exe c:perlbinperl.exe. Therefore, to run the CGI scripts, please rename all the files to extension .pl . You may relocate all the CGI scripts into the scripts folder. Please remember to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[60],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25895"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=25895"}],"version-history":[{"count":4,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25895\/revisions"}],"predecessor-version":[{"id":37068,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/25895\/revisions\/37068"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=25895"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=25895"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=25895"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=25895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}