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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem runing Perl using Apache2 1

Status
Not open for further replies.

mig20001

IS-IT--Management
Oct 22, 2004
14
US
I am new to Apache. I installed Perl and Apache2. Everything looks like installed correctly. The problem I have is when I execute my submit button to which calls for the PL program to execute, the browser opens up with the Perl source code. I believe it means that the script IS NOT been executed.

If I go into the Perl directory, I can execute the PERL program using the DOS prompt. SO, the problem is NOT the PERL - it is more likely that the Apache is NOT executing my script. I read in the APache.org about making the directly of cgi-bin the default for executing PERL and that is how I exactly I have it. I think there is something to do with the configuration file and I can not figure this out
 
This might be a bit of an obvious suggestion but...

You'll need, I think, to set-up an associiation between the .pl extensions and perl.exe - as there is probably an association already on your PC between .doc and winword.exe

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
From what I can tell, everything is set up right. Try to see if it's your ScriptAlias that's not working by moving your script to C:/Program Files/Apache Group/Apache2/ and pointing your form to that location instead. Your config file also tells Apache to execute .cgi or .pl scripts in this directory so it should work there as well.

I really can't see why your scripts won't execute, unless you added/uncommented the scriptalias line and didn't restart the server.

 
Please let me know if you all can get into the image or not. Thanks.
 
That screenshot helped.... you're not going through your web server. The page you're viewing is 'C:\...', which is just showing you the file on your hard drive and is not getting served up by Apache. Try going to " in IE and see if that works.
 
Thank you so much. That was the problem... After looking at the screen for a long time, you forget where you are. I needed to start the page from Localhost.

Thanks in advance for all of your help.
 
With apache in windows, you can add "ScriptInterpreterSource registry" to httpd.conf and it'll use the windows association for .pl/.cgi/whatever instead of looking for a #! line. This has the added benefit that if your production server runs *nix and your dev box is in windows, you can add the proper *nix #! and let windows use the registry. No code change for roll-out.

Anyway, it's an either-or thing. Glad you have your problem worked out. I've spent many hours on stuff just as bad.

________________________________________
Andrew

I work for a gift card company!
 
haven't we all
* 4 the after attention

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top