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

exec cgi 1

Status
Not open for further replies.

zvrcvm

Programmer
Aug 1, 2002
23
MX
I have a problem calling a perl script on my server.
I have installed apache 2.0.39.
I have configured the cgi-bin directory correctly.
In fact, if I call the script through the browser, it works perfectly.
But, from inside the html code of the page, it gives no result.
I call it by <!--#exec cgi=&quot;/cgi-bin/myscript.pl&quot; -->
and it does not work.
If I run it trough <img src=&quot;/cgi-bin/myscript.pl&quot;> it works but does not give any result on the screen.

Who can help me??

Thanks

Giorgio
 
Thanks Wullie,

&quot;does not work&quot; means that the command
<!--#exec cgi=&quot;/cgi-bin/myscript.pl&quot; -->does not execute the script.

The command <img src=&quot;/cgi-bin/myscript.pl&quot;> really execute the script (that increments a counter in a different file), but does not print the result on the screen.

This problem is for any perl - cgi script I tried.

I have to solve the problem because I'm installing this server to give hosting service to my clients. It's my first experience with apache 2 on freebsd 4.6. I've worked on previous versions without any problem.

thanks

Giorgio

 
Do you have ExecCGI and Includes enabled in the directory that you have that page in? Is the command still there when you view source on the resulting page? //Daniel
 
Yes, to both questions.
Where the hell can be the problem???
:))


Thanks

Giorgio
 
If the <!--#exec .. --> line is on the resulting page as a comment, it means that the page wasn't parsed as a SSI page. What extension have you associated to SSI documents and is that extension the same as the file's exntesion? //Daniel
 
Thank you Daniel, very much.

After your last message I've solved the problem I added a .htaccess file into the cgi-bin directory with the content:

Options Indexes FollowSymLinks Includes ExecCGI
AddType text/x-server-parsed-html .html

and all went OK.

What I do not understand is that the same configuration I gave for the same directory in the httpd.conf file. Why did it not work???

Giorgio
 
To ask the stupid question, did you restart apache after you changed your httpd.conf? //Daniel
 
:)) sure!!
I tried the same on another directory, with the same problem: it only works through the .htaccess file and not through the httpd.conf.
May be a new &quot;special&quot; feature of version 2 of apache?? :))

Giorgio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top