chuck Posted December 18, 2013 Posted December 18, 2013 I have a strange problem with a CGI program written in Perl on Johnny. I have a report from a user that when they invoke the script or hit one of the buttons it creates (which re-runs the script) that sometimes the code downloads instead of running the script. The script is in my /scgi-bin folder, and has a .cgi extension. It runs normally (most of the time) on Windows using Internet Explorer 8 or 11 (what I have). One of my testers was running Chrome on a MacBook and got the strange behavior. The thing is, I didn't know that the browser or operating system could even do this. I'd expect that the server would always run the program or download it when it receives a request for that URL. By the way, the "most of the time" seems to be another glitch that I can't explain. Sometimes when I try to invoke the script it gives me a bit of garbage text instead of the form I expected. Generally hitting refresh will clear this. Any help with either of these behaviors would be appreciated.
Ice IT Support Posted December 18, 2013 Posted December 18, 2013 Could you post the URL to your script please? From http://heliohost.org/home/features/languages/perl :Perl scripts are easy to configure and run. Just create a file in your cgi-bin directory under public_html, and place the Perl "shebang" line (#!/usr/bin/perl) on the first line of the file. Below this line you may write Perl code. Make sure you make this file's CHMOD permissions 755, and output a Content-type header before anything else.
chuck Posted December 19, 2013 Author Posted December 19, 2013 You can use http://chuck.heliohost.org/scgi-bin/nph-TeamRegistration.cgi?start=admin;affiliate=999 to run the program. For testing, you can use admin as the user name and test as the password. There's no data in the database, but you can push a few buttons and navigate to a few different pages. This is an upgrade to a program I have been working on for a few years now and had hosted on another site last year.
Byron Posted December 19, 2013 Posted December 19, 2013 The first time I clicked onto your link with Chrome, I got the download screen but after that it gave me the page each time. I thought it might have something to do with the way you append your url with the semicolon (?start=admin;affiliate=999) so I added a few more semicolons to the url and got the download screen again. Can you append the url without the semicolon? Maybe like this: ?start=admin&affiliate=999
chuck Posted December 19, 2013 Author Posted December 19, 2013 That seems to work OK for me. I'll ask my other tester to give it a try. Any ideas on the garbage output that I get now and again? It often happens the first time I try to run a site, but sometimes when I push a button. The output reminds me of what we used to get in the old days with a noisy modem line. I can't make it happen on demand, though.
Byron Posted December 20, 2013 Posted December 20, 2013 Any ideas on the garbage output that I get now and again? It often happens the first time I try to run a site, but sometimes when I push a button. The output reminds me of what we used to get in the old days with a noisy modem line. I can't make it happen on demand, though. I have know idea what that could be.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now