Setting perl for wamp/www
Posted by: Amir Ali (---.customer.teleport-iabg.de)
Date: April 11, 2006 12:46PM

I am able to run perl scripts from [localhost]
BUT
when configuring perl scripts for wamp/www i am facing problems. I even tried to change:

Options Indexes FollowSymLinks

TO:

Options Indexes FollowSymLinks Includes +ExecCGI

but still it doesnt help me. Is there anything else i need to check? please guide me so that i'll able to run my pl and cgi scripts from wamp/www.

At the moment the pl scripts are output as plain text when i try to run them like:
[localhost]

please help me out
Thanks.



Amir Ali
Software Engineer

Options: ReplyQuote
Re: Setting perl for wamp/www
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 11, 2006 09:38PM

Make sure you have installed the WAMP Active perl addin first.

You said you changed the directory Option directive, but there are many places in the httpd.conf file to change options for different directories. You most likely changed the wrong one. Change the line you edited back to:
Options Indexes FollowSymLinks

In your httpd.conf file, find this line:
<Directory "C:/wamp/www">

Now, about 14 lines below that line, you will see this:
Options Indexes FollowSymLinks

Change that line to:
Options Indexes FollowSymLinks Includes +ExecCGI

Save the file, restart apache for the new settings to take effect. Adding the +ExecCGI in the Options directive for the directory C:/wamp/www enables you to run perl scripts in your www directory now.

Options: ReplyQuote
Re: Setting perl for wamp/www
Posted by: Amir Ali (---.customer.teleport-iabg.de)
Date: April 12, 2006 07:23AM

I am sure that i have installed the perl add-on for wamp1.6 as i am able to run perl scripts from:
[localhost]

but when putting the test.pl inside wamp/www and running it from
[localhost]
The browser is outputing the whole contents of the test.pl as plan text. rather then executed code's output..

I checked my httpd.conf and I have changed the correct line to

Options Indexes FollowSymLinks Includes +ExecCGI

this is for directory <Directory "F:/wamp/www">

is there anything i am missing or am I trying to execute the .pl scripts inside wamp/www the wrong way by typing [localhost] ??



Amir Ali
Software Engineer

Options: ReplyQuote
Re: Setting perl for wamp/www
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 12, 2006 09:23AM

since we just made it possible to run perl scripts from your www directory, move your test.pl file to it:
F:/wamp/www

Test it:
[localhost]

Also, all perl files have to have to have the correct location to perl on the very first line of code. So, open the file in a text editor and make sure the very top line is set to this:
#!F:/wamp/perl/bin/perl

If not, change it.

If that does not work, try change the file extention to cgi, and then test it again.

If you get any errors, let me know what errors you get.

Options: ReplyQuote
Re: Setting perl for wamp/www
Posted by: Amir Ali (---.customer.teleport-iabg.de)
Date: April 12, 2006 12:11PM

I am getting the same error since the begining.

when i am typing [localhost]

The browser is outputing the whole code from test.pl as plain text. the webserver should output the outputs of the executed code at server side. but thats not happening here. Its like opening a text file from a browser. I hope you understand what I mean.

And the first line is pointing to the correct path of perl too.

Still no luck.

Although when we put the test.pl at wamp/apache2/cgi-bin/test.pl everything works fine by typing [localhost]



Amir Ali
Software Engineer

Options: ReplyQuote
Re: Setting perl for wamp/www
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 12, 2006 08:54PM

if you can run this script from cgi-bin directory, then perl does work. if you can not get it to run correctly in the www directory,then you set the wrong directory directive in the httpd.conf file. you need to make sure it is<Directory "F:/wamp/www">.

If you have the write directory set,then try changing it to this:
Options Indexes FollowSymLinks Includes ExecCGI

Also remember everytime you edit the httpd.conf file, you need to restart apache for the new settings to take effect.

Also try changing:
#AddHandler cgi-script .cgi

to
AddHandler cgi-script .cg

Also double check that mod cgi is enabled. If it has a # in front of it, remove it so the line looks like this:
LoadModule cgi_module modules/mod_cgi.so

Options: ReplyQuote


Sorry, only registered users may post in this forum.