Page 1 of 1

.cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 08:45
by jwzumwalt
I followed the instructions carefully given in other posts on how to set up a cgi-bin directory. When I attempt to execute a .cgi or .pl file I get a ms windows dialog box asking if I want to save or open it.
Thanks for the help - jz

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 08:50
by Izzy
jwzumwalt wrote:I followed the instructions carefully given in other posts on how to set up a cgi-bin directory
Mind tellings me what you did exactly to set up a cgi-bin directory as I can't see what you mean and therefore have no idea how to help you?

Also how are you trying to access this mystery directory in your browser - what url?

Where is this directory located in the xampp installation tree?

Is Apache running and how do you know?

Any clues in the xampp\apache\logs\error.log file

Etc. etc.

Remember we can only see what you relay to us that which you can see.

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 09:25
by jwzumwalt
1) apache eror message [Thu Jan 15 00:21:12 2009] [error] [client 127.0.0.1] attempt to invoke directory as script: C:/xampp/htdocs/cgi-bin/

2) here is the result http://www.neatinfo.com/temp/pic1.png

3) here is my apache config file http://www.neatinfo.com/temp/httpd.conf

thanks for the quick reply!

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 09:47
by Izzy
EDIT - (Everything looks in order in the images).
There are issues with the httpd.conf file pointed out in a later post.

Try http://127.0.0.1/cgi-bin/printenv.pl

Can you see the XAMPP Welcome page by going to http://localhost

Also open the file in the text editor and check the first line (shebang) contains the correct path to the perl.exe file.

Mine looks like this:
#!"C:\xampp\perl\bin\perl.exe"

I have just tested on a 1.7.0 vanilla install on XP and printenv.pl displays the Environment Variables just fine.

Are you on Vista?

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 09:49
by Wiedmann
I followed the instructions carefully given in other posts

What have you done exactly?

BTW:
to set up a cgi-bin directory

"cgi-bin" is ready to use in a default XAMPP installation and accessing "printenv.pl" should work out of the box.
--> No need to configure anything.

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 09:51
by jwzumwalt
1) I just switched from WAMP to XAMPP today. And loaded the default XAMPP twice - it did this from the very start so I tried to manually configure the httpd.conf file.

2) Thanks for looking at it... It seems like the MS command prompt file association is somehow overriding the Apache server trying to do its thing!!! I looked at my envirionment varibales but could not see anything out of place.

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 10:00
by Izzy
Izzy wrote:Mind telling me what you did exactly to set up a cgi-bin directory...?
Mind answering this please as it has now been asked 2 times?

This in your httpd.conf file is not the default:
<Directory "C:/xampp/htdocs/cgi-bin">
AllowOverride All
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all
</Directory>

The default looks like this:
<Directory "C:/xampp/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

This line then is also not the default:
ScriptAlias /cgi-bin/ "C:/xampp/htdocs/cgi-bin/"

The default is:
ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"

Also this is not in the default httpd.conf file:
Include conf/extra/perl.conf
Did you install the perl addon?

Try reverting all your changes to the install defaults as the file you are trying to access will work on a default XAMPP installation.

Always make a backup of any conf or ini file before editing then you can always revert if necessary.

Problem Solved

PostPosted: 15. January 2009 10:43
by jwzumwalt
Problem Solved
I decided to look at MS file explorer associations and both .cgi and .pl had a "run" association for "Perl.exe" When I deleted the run association it started to work! SO for some reason I am unable to have a DOS box file association live happily with XAMPP Apache. One of the reasons that I decided to try XAMPP today instead of WAMP is I had had perl problems with WAMP too :(

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 15. January 2009 10:49
by Izzy
Thanks for posting back with your solution.

IMHO most of your issues with XAMPP have been caused by wamp which more than likely has changed things in the registry and in the paths which have not been cleared when uninstalling it.

From the readme_en.txt file in the xampp folder.
Note: XAMPP makes no entries in the windows registry and no settings for the system variables.

Re: .cgi and .pl files open a "file save" dialog box

PostPosted: 12. February 2009 19:44
by OLDo
Had the same problem after removing WAMP (having tried to integrate ActivePerl, unsuccessfully).

The solution was to search the registry for perl.exe, and delete any entries, especially those with relation to wamp. Hope this helps someone. :)