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!

Cgi script doesn't execute correctly on browser

Status
Not open for further replies.

adelinewss

Programmer
May 22, 2000
20
SG
Hi,<br>I had just installed perl5 on my machine.&nbsp;&nbsp;when i try to execute cgi script i.e xxx.cgi on browser, i will see the content of the source code and not the output.&nbsp;&nbsp;My cgi script is stored same directory as my webpage i.e /htdocs/xxx/xxx.cgi.&nbsp;&nbsp;Any advice on this?&nbsp;&nbsp;<br><br><br>Thks with regards,<br>Adeline
 
What happens if you put the program into the &quot;cgi-bin&quot; directory?&nbsp;&nbsp;My guess is that it will work OK.&nbsp;&nbsp;I think the problem is that your web server doesn't know that /htdocs/xyz is allowed to run scripts.&nbsp;&nbsp;You will need to take a look at your server configuration I think.
 
Hi,<br>I tried to put it inside cgi-bin directory and tried to execute it directly from browser but still get the same result.&nbsp;&nbsp;I configured my server as ScriptAlias /cgi-bin/ &quot;/usr/local/apache/cgi-bin/&quot;&nbsp;&nbsp;and put my cgi script inside /usr/local/apache/cgi-bin.&nbsp;&nbsp;Is this correct?&nbsp;&nbsp;Pls advice.&nbsp;&nbsp;Thks.<br><br><br>Rgds,<br>Adeline&nbsp;&nbsp;
 
Adline,<br><br>There was a similar post to this a couple of days ago and that one turned out to be file associations. Try renaming your file from xxx.cgi to xxx.pl -- I'm assuming that you have the association with perl.exe and .pl files set up, you can test that by renaming the file, cd'ing to the cgi directory and trying to run the file by typing xxx.pl<br><br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Please -- Don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
What am I thinking of? Doh! &lt;hits head on desk&gt; ignore that last post - I was thinking in NT mode for a while there (in a Unix forum -- well done Mike)<br><br>Ok - Unix mode<br><br>What are the file permisions on your perl scripts Adeline? <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Please -- Don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top