Problem in CGI

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problem in CGI

Postby mahes » 04. February 2008 10:50

HI friends,

I want to run cgi script in xampp. i do not know how to change the configuration in ini files. If any body know how to run a cgi script as like php

Thanks in advance
mahes
 
Posts: 20
Joined: 04. February 2008 10:47

Postby Izzy » 04. February 2008 13:04

CGI is already configured and working in the default XAMPP installation using MiniPerl.
Click on these links when your Apache server is running:
http://localhost/cgi-bin/perltest.cgi
http://localhost/xampp/perl-info.php

The example perl scripts below are in the XAMPP cgi-bin directory:
.\xampp\cgi-bin
and this is the location you could put your own scripts, then call them in your browser like this:
http://localhost/cgi-bin/mycgiscript.cgi

For example, click on this link when your Apache server is running:
http://localhost/cgi-bin/perltest.cgi

Or click on this to run a cgi script that will show you your system environment variables:
http://localhost/cgi-bin/printenv.pl

Make sure that you have the path to the perl interpreter as the first line of your own scripts (the Shebang).
Fo example:
#!"C:\xampp\perl\bin\perl.exe"
Your path to perl may be different.

If you want to run .cgi perl scripts and .pl perl scripts from the htdocs directory then change this line near 423 in .\xampp\apache\conf\httpd.conf
AddHandler cgi-script .cgi

so it looks like this:
AddHandler cgi-script .cgi .pl

Save the file and restart Apache and remember to make a backup of conf and ini files before changing anything.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby AceD » 07. February 2008 19:54

Hi!
I've got strange problem with my CGI-proxy script:
http://91.121.3.8/cgi-bin/nph-proxy.cgi
Script listing:
http://91.121.3.8/proxy/nph-proxy.txt

Project homepage: http://www.jmarshall.com/tools/cgiproxy/

Why it's blanc? I have no idea why it isn't working as it should...
AceD
 
Posts: 1
Joined: 07. February 2008 17:56

Postby Izzy » 08. February 2008 01:36

AceD wrote:Hi!
I've got strange problem with my CGI-proxy script:
http://91.121.3.8/cgi-bin/nph-proxy.cgi
Script listing:
http://91.121.3.8/proxy/nph-proxy.txt

Project homepage: http://www.jmarshall.com/tools/cgiproxy/

Why it's blanc? I have no idea why it isn't working as it should...
I don't understand your issues.

Your proxy script should be called nph-proxy.cgi not nph-proxy.txt
What happens when you only go to http://91.121.3.8/

What happens when you go to http://91.121.3.8/cgi-bin/nph-proxy.cgi

Where have you put your proxy script?

Why is there 2 different addresses and files:
http://91.121.3.8/cgi-bin/nph-proxy.cgi
http://91.121.3.8/proxy/nph-proxy.txt

How have you set up XAMPP so it can be accessed from this IP address:
http://91.121.3.8

What happens when you go to:
http://localhost

Put the nph-proxy.cgi script in the xampp\htdocs directory and go to:
http://localhost/nph-proxy.cgi
and tell me what happens.

Now move (don't copy) the php-proxy.cgi script to the xampp\cgi-bin directory and go to:
http://localhost/cgi-bin/nph-proxy.cgi
and tell me what happens.


I have Marshall's proxy script set up on my PC running on the XAMPP server without any issues.

I can see that French is your language and English is not, but you still have to try and explain your problem so it can be understood, by including as much detail as possible about how things are set up and what you have tried to do, so we can help fix your issues..
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

hi how to run cgi in php script

Postby mahes » 18. March 2008 08:40

Hi all,

I want to run perl script which is located in php projects,so how to run perl and php in same folder. Currently should run php without any problem,,
mahes
 
Posts: 20
Joined: 04. February 2008 10:47


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 35 guests