Running CGI locally

Forgive me if this is a dumb question, but is there a way to run cgi scripts locally? My OS is Windows ME.

Barring that, if anybody can suggest a (free?) text editor that won’t cock up the commas within fields of CSV database files, I’d be eternally grateful.

The long and short: I’m setting up a csv database using EZscripting’s suite of scripts. This is the first time I’ve worked with databases of any sort.

See as to how I’ve got one phone line, I don’t particularly wanna tie it up builing the database through the submission script for the several hours it’s going to take to screw everything up a few times.

I have minimal perl experience, mostly diddling around with Ikonboard hacks.

Danke.

Sure, there’s a way to run CGI scripts locally. Download and install some free web server software, like Apache. If you want to set up a database also, check out MySQL. Both of these are free and open source.

I’ve heard that some people (those who aren’t really sure what they’re doing… yet;), i.e. me), have trouble installing these apps individually and getting them to run together. The easy way around this is to download and install a package dealie like the one found here. It’s a preconfigured package that includes Apache, MySQL, PHP, and phpMyAdmin. All you have to do is unzip the package, and you’re ready to go. It was a painless install for me. All you have to do is unzip the file into your root directory, and that’s it.

It doesn’t include Perl, but it does include PHP, which is more fun anyway =Þ.

Have fun!

Whoa, what happened to my post?!

The first paragraph should’ve read:

Download and install some free web server software like Apache. If you want a database, check out MySQL. Both of these are free and open source.

*Note to self: Preview, preview, preview…

I know I typed it correctly that time. What’s going on?

I’ll just give you the links, instead of trying to get all fancy.

http://www.apache.org
Go here and grab a copy of Apache Web Server.

http://www.mysql.com
Go here and grab a copy of MySQL database software.

orr is way off base.

A cgi program is a program (Well duh!) that runs on the remote system. To run it you need to be able to run that type of program on your system. If it is a compiled executable, you need to be able to run that. E.g., if it was compiled under Linux for x86 architecture using the new gcc libs, you need to be running Linux on an x86 machine with the new gcc libs.

If it is a script, you need whatever runs that script: perl, csh, and so on. Hundreds of possiblities here.

If you are extremely lucky, it’s a (server side) Java program which you can run with just a Java interpreter.

On the other hand, maybe the CGI-program is written in some guy’s personal favorite script language that he invented and is the only user of.

One thing to know: You probably can’t just download a favorite CGI program, the server would normally be set up to only run the program, not feed it to you directly.

If you have created/copied a CGI program on your own, you do not need a web server to run it. You just need whatever the web server will use to run it. So if it’s a Perl script, you just need Perl. Installing Apache will give you Perl (even a 2nd waste of disk space copy if you already have it!) but you can just get and install Perl.

If you have source code (in C++ or whatever) you will need to compile that with a suitable compiler.

(Proviso: if the CGI program generates html, then you might want something to view html, etc. etc.)

Thanks, both of you.

I realized the error of my ways the other night.

I was sitting around, trying to call up perl from MS-DOS. Only after a few hours of hair pulling did I discover that perl isn’t included with Windows ME. Bastards.

Perl for Windows: http://www.activestate.com/

Never used it personally, (I do all my Perl coding on FreeBSD and Linux) but I hear it works.

You can get Apache here: http://www.apache.org/

Make sure you download the Windows binaries and not the source files.

You can use this stuff to set up your CGIs on your own machine. If you’re using a CSV database, then you don’t need MySQL (or any other database server.)

If you’re using perl (the ActiveState one is fine) to run the CGI, then odds are that you won’t even need a webserver. If coded correctly, the perl CGI will even detect that you’re running it from command line and adjust its input and output accordingly.