{"id":931,"date":"2018-03-04T00:23:40","date_gmt":"2018-03-04T00:23:40","guid":{"rendered":"https:\/\/webhostingplus.uk\/hosting\/?p=931"},"modified":"2018-03-04T00:23:40","modified_gmt":"2018-03-04T00:23:40","slug":"cgi-perl-script-fail-error-500-internal-server-error","status":"publish","type":"post","link":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/","title":{"rendered":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)?"},"content":{"rendered":"<p>These errors are nearly always related to a coding error within the script, or bad variables being passed into the script. If you encounter an error &#8220;<strong>500 Internal Server Error<\/strong>&#8221; whilst running your CGI and Perl scripts, try the following in order: <\/p>\n<p>&#8211; Ensure you have uploaded the script through FTP using ASCII mode (not Binary), or that it has Unix-style carriage returns. <\/p>\n<p>&#8211; Check the interpreter path on the first line of the script. For Perl it should always be &#8220;#!\/usr\/bin\/perl&#8221;. <\/p>\n<p>&#8211; Make sure the script filename ends in either &#8220;.pl&#8221; or &#8220;.cgi&#8221;. <\/p>\n<p>&#8211; Make sure the script can execute. It should have permissions of &#8220;755&#8221;. Most FTP clients support this. <\/p>\n<p>&#8211; Put &#8220;use CGI::Carp qw(fatalsToBrowser);&#8221; into the second line of your script. This will make Perl print the error instead of the &#8220;500 Internal Server Error&#8221; page, and will allow you to find out where your script is breaking. <\/p>\n<p>Other potential problems include bad syntax in an .htaccess file (if you&#8217;ve created\/edited one). Check your error log for details (there are articles on how to get to your error logs). <\/p>\n","protected":false},"excerpt":{"rendered":"<p>These errors are nearly always related to a coding error within the script, or bad variables being passed into the script. If you encounter an error &#8220;500 Internal Server Error&#8221; whilst running your CGI and Perl scripts, try the following in order: &#8211; Ensure you have uploaded the script through FTP using ASCII mode (not &#8230; <a title=\"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)?\" class=\"read-more\" href=\"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/\" aria-label=\"Read more about Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)?\">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":[27],"tags":[],"class_list":["post-931","post","type-post","status-publish","format-standard","hentry","category-perl-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus\" \/>\n<meta property=\"og:description\" content=\"These errors are nearly always related to a coding error within the script, or bad variables being passed into the script. If you encounter an error &#8220;500 Internal Server Error&#8221; whilst running your CGI and Perl scripts, try the following in order: &#8211; Ensure you have uploaded the script through FTP using ASCII mode (not ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting Plus\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-04T00:23:40+00:00\" \/>\n<meta name=\"author\" content=\"webhostingplus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhostingplus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/\"},\"author\":{\"name\":\"webhostingplus\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/person\\\/ac818f1a9ee343e82657049f7c97c9dc\"},\"headline\":\"Why does my CGI\\\/Perl script fail with an error 500 (Internal Server Error)?\",\"datePublished\":\"2018-03-04T00:23:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/\"},\"wordCount\":198,\"publisher\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\"},\"articleSection\":[\"Perl Scripting\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/\",\"name\":\"Why does my CGI\\\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#website\"},\"datePublished\":\"2018-03-04T00:23:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/cgi-perl-script-fail-error-500-internal-server-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why does my CGI\\\/Perl script fail with an error 500 (Internal Server Error)?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#website\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\",\"name\":\"Web Hosting Plus\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\",\"name\":\"Web Hosting Plus\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/wp-content\\\/uploads\\\/Web-Hosting-Plus-Logo.png\",\"contentUrl\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/wp-content\\\/uploads\\\/Web-Hosting-Plus-Logo.png\",\"width\":339,\"height\":78,\"caption\":\"Web Hosting Plus\"},\"image\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/person\\\/ac818f1a9ee343e82657049f7c97c9dc\",\"name\":\"webhostingplus\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus","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:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/","og_locale":"en_GB","og_type":"article","og_title":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus","og_description":"These errors are nearly always related to a coding error within the script, or bad variables being passed into the script. If you encounter an error &#8220;500 Internal Server Error&#8221; whilst running your CGI and Perl scripts, try the following in order: &#8211; Ensure you have uploaded the script through FTP using ASCII mode (not ... Read more","og_url":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/","og_site_name":"Web Hosting Plus","article_published_time":"2018-03-04T00:23:40+00:00","author":"webhostingplus","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webhostingplus","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/#article","isPartOf":{"@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/"},"author":{"name":"webhostingplus","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/person\/ac818f1a9ee343e82657049f7c97c9dc"},"headline":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)?","datePublished":"2018-03-04T00:23:40+00:00","mainEntityOfPage":{"@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/"},"wordCount":198,"publisher":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#organization"},"articleSection":["Perl Scripting"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/","url":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/","name":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)? - Web Hosting Plus","isPartOf":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#website"},"datePublished":"2018-03-04T00:23:40+00:00","breadcrumb":{"@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webhostingplus.uk\/hosting\/cgi-perl-script-fail-error-500-internal-server-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webhostingplus.uk\/hosting\/"},{"@type":"ListItem","position":2,"name":"Why does my CGI\/Perl script fail with an error 500 (Internal Server Error)?"}]},{"@type":"WebSite","@id":"https:\/\/webhostingplus.uk\/hosting\/#website","url":"https:\/\/webhostingplus.uk\/hosting\/","name":"Web Hosting Plus","description":"","publisher":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webhostingplus.uk\/hosting\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/webhostingplus.uk\/hosting\/#organization","name":"Web Hosting Plus","url":"https:\/\/webhostingplus.uk\/hosting\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/logo\/image\/","url":"https:\/\/webhostingplus.uk\/hosting\/wp-content\/uploads\/Web-Hosting-Plus-Logo.png","contentUrl":"https:\/\/webhostingplus.uk\/hosting\/wp-content\/uploads\/Web-Hosting-Plus-Logo.png","width":339,"height":78,"caption":"Web Hosting Plus"},"image":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/person\/ac818f1a9ee343e82657049f7c97c9dc","name":"webhostingplus"}]}},"_links":{"self":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":0,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"wp:attachment":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}