January 12th, 2001, 07:08 PM
I am working on a machine with windows 98, ActivePerl and Apache for windows. I have set this up so I can learn Perl and test CGI scripts. Whenever I try to generate a web page on the fly via a perl script It appears as text in a DOS window. I have used many different scripts but the result is always the same. ActivePerl seems to be functioning in all other respects. The Apache server seems to be working ok. I have spent days on this and followed many7 suggestions to no avail. Can any one suggest a solution???????
January 14th, 2001, 07:03 AM
I'm not sure how Apache works on a PC but you might want to try and modify the file folder parameters for that ???.cgi files. Open Explorer and goto "View...options" then on "File Types" I think Win98 is executing a dos shell for that type of file.
Are you trying to run the CGI script from the Browser? in the URL : //c|perlperlprogssomething.cgi
Not sure you might have to give more information on settings and configuration for acurate diag...
January 14th, 2001, 03:55 PM
I am no further on but you may have found an area where I lack understanding.
The scripts I have been executing have the perl extension .pl. so that is what I have put in the html Form Action
I then go to the browser bring up localhost, navigate to the page with the form fill it out press submit.... etc
I don't really understand what it is that governs the action that is taken when the script is executed.
There doesn't seem to be anything that says to open a Dos shell but that is what it does..
C:PERLBINPERL.EXE "%1" %* is what appears in the box for "application used to perform action".
I obviously need to know more about this stuff.
Any further help would be greatly appreciated.
January 15th, 2001, 06:13 AM
I think WINDOWS will excecute a dos window because when you installed perl (I think) it entered a Registry entry that defines what application to execute those types of files.
Have you tried to rename your scripts with the .CGI instead of .PL? What does your "View-->options -->File Types" say for a .CGI file?
January 15th, 2001, 02:59 PM
It lists c:windowsNOTEPAD.EXE "%1" as the application used to perform the action. Any idea what I should change this to??? as this is definitely not what It should be.
January 15th, 2001, 06:22 PM
Well, you could always check the FAQs over at http://www.activestate.com/ and see there.
But I will spare you the trip. What got me working, is quite simple: you need to put the ordinary UNIX-like shebang at the beggining of your CGI script, but with a Windows-like path. To make it simple:
#!cerlbinperl.exe (any switches)
This worked for me, and is still working on Windows 2000 Pro. (tried first on Windows 98). The thing you mentioned is simply an "association" to a certain file extension in the Windows Explorer. It has nothing to do with Apache.
January 15th, 2001, 10:41 PM
No. I have already done that in all my scripts. Same Result...text in a Dos window.
January 16th, 2001, 01:28 AM
Well as I said before, I don't know that much about Apache but I know that you can assign what application to assign a file .??? by going into Explorer and pressing "shift" and right clicking on the file and you will see an option to "Open With" and that will bring up a window that will allow you to change the application that it executes with.
Is there a configuration setting on Apache that will let you define a folder with permissions? I know that when I was setting up a web site at work I had to have the Administator change the directory (CGI-BIN)to execute vs. read a flat file (HTML). You might have to contact the software support for Apache about this.
January 16th, 2001, 04:10 AM
Have you configured Apache to execute CGI scripts, with the ScriptAlias etc. directives??
Here is the link to the FAQ I was talking about:
But as I read it, I can only see one potential problem, and that is that you haven't configured your Apache.
[Edited by dwarf on 01-16-2001 at 02:23 AM]
January 16th, 2001, 08:44 PM
Thanks for all the help dark_jurmanji and dwarf. Problem solved. Apache was configured incorrectly. This may not have been the only problem, I tried so many things I lost track of it all but it is up and running now. Yeeehaaaa!!!
January 17th, 2001, 01:11 AM
Not a problem. Just keep those FAQs handy...