Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed in setting Apache to run CGI through win registry

Status
Not open for further replies.

apet

Programmer
Jul 12, 2006
4
CA
Hi,

I have problems running cgi scripts on Apache server. cgi scripts are part of Bugzilla 2.22 installation on Apache 2.2. Perl version is ActivePerl 5.8.8.817 and OS is MS Win Server 2003.

cgi scripts run fine when using the first line #!... to find Perl interpreter, but when I add line

ScriptInterpreterSource registry

to Apache httpd.conf file in order to find Perl interpreter through the registry, it doesn't work, page is opening for a while and ends in the following error:

Premature end of script headers: index.cgi

I have

AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit

in Apache config file.

What should I do to make Apache find Perl through win registry?
Any help is greatly appreciated,

Anita
 
You need to set a file association between .cgi and the perl interpreter.

find a .cgi file in win32 explorer and double click it When prompted to select the program to use to open it, drill down to your perl interpreter. Check the box "Always Use This Program.."

Or, You can go to explorer Tools | Folder Options | File Types and setup .cgi to 'open' with the perl interpreter.

JB
\0
 
Thx, but I've done that and I still have the same problem.
Is there anybody who got this working with Apache 2.2?
 
then a script works, it runs in the command prompt window.
 
Have you seen this?
In order for ScriptInterpreterSource Registry-Strict to work, you also need to add an entry to the Registry so Apache will use Perl to execute .cgi files.

Create a key HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command with the default value of the full path of perl.exe with a -T parameter. For example C:\Perl\bin\perl.exe -T
from
Jeb
 
That was it. It works now. Thanks!!

Anita
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top