# Pearl and IIS 6.0



## doublewam (Aug 22, 2003)

I am trying to get Pearl to work under IIS 6.0 and cannot seem to get it to work.

In another post I read:

"If you have IIS 6.0, you also have to create the extension under "Web Extensions" in IIS config."

Could someone please elaborate on this...provide me with some step by step instructions? Any help would be greatly appreciated.


----------



## Shadow2531 (Apr 30, 2001)

Under Web Extensions, you have to add the .pl extension with the path to perl.

The path should look like this.

*C:\Perl\bin\perl.exe "%s" %s*

Then you must allow it.

(The "%s" %s is the key. I had the guy at the perl site, put that in their faq awhile ago.)

(Assuming Default Website)

You have to 
right-click on Default Website
left-click on properties
switch to home directory tab
click configuration button
Add the .pl extension and use the same path as above.

Now to make cgi work
Add the .cgi extension in the home directory configuration and under the web extensions.

the path for the .cgi extension should be
*C:\WINDOWS\system32\inetsrv\ssinc.dll*

Then you will be able to use the .cgi extension for serverside includes and internal perl, python, php, asp scripts.

Also under the home directory tab, set execute permissions to scripts only and set local path to c:\inetpub\wwwroot if it's not already and just have the "read" box checked for now.

Under the documents tab, you can add default page filenames.
For example if you want to have index.cgi as your index page, add that to the list.

Not sure which perl interpreter you have, but I use the one from www.activestate.com
I installed it to the default location, which is the path above.

If you still cannot get it to work, goto
start
settings
control panel
internet options
security tab
Set All site types except restricted sites to medium
Then use http://localhost using Internet Explorer

However, if you decide to use apache instead, you should install perl to c:\usr so that perl.exe is located at c:\usr\bin.


----------



## Shadow2531 (Apr 30, 2001)

Here is a perl script that works under IIS 6.0 with the above config.

*#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

print "Hello, world!\n";*

save that as test.pl and save it again as test.cgi

Now here is a cgi script that uses serverside includes
(it includes the test.pl that you just saved)



save that as include.cgi

Save test.pl, test.cgi and include.cgi to the wwwroot folder for testing.

Later you can config it like you want.

That will allow you to test everything.
You won't need to use the .shtml extension for anything unless you want to.

I really suggest using apache instead of IIS, but that's up to you.


----------



## doublewam (Aug 22, 2003)

Shadow2531,

I did enrything you described but it still does not work.

When I try to run any Pearl using IIS 6, I get the following error...

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.


I can run Pearl from the Dos window but IIS 6 is being a royal pain. Any ideas?


----------



## Shadow2531 (Apr 30, 2001)

Do you have the following line in your script?

print "Content-type: text/html\n\n";


Where did you download perl from?

Try reinstalling perl. Sometimes certain registry settings are not written on installation. and you have to reinstall.

Also instead of #!/usr/local/bin/perl

try #!/usr/bin/perl

what directory is perl located in on your computer?


----------



## Shadow2531 (Apr 30, 2001)

I have IIS 6.0, but don't use it anymore. I use apache instead. If you can't get IIS 6 to work, try apache.


----------

